An open API service indexing awesome lists of open source software.

https://github.com/hrszpuk/odin-flag

Command-line flags package for odin
https://github.com/hrszpuk/odin-flag

command-line library odin odin-lang odin-programming-language package

Last synced: 3 months ago
JSON representation

Command-line flags package for odin

Awesome Lists containing this project

README

        


Odin-flag


A simple, easy to use command line flag parser for Odin.






Installation   
User Guide   
Contributing   


```odin
package main

import "core:fmt"
import flag "../.." // path to package

main :: proc() {
using flag

flags := flagset()

count := 1
send := false
msg: string

flags->add("count", &count, int)
flags->add("send", &send, bool)
flags->add("msg", &msg, string)

flags->parse()

if send {
for _ in 0..free()
}
```
✨ For more examples see the User Guide

## Installation
The recommended way to install odin-flag is to use git submodules.

In your project, create a directory called "external" (or alternative name) and run the command below.
```
git submodule add https://github.com/hrszpuk/odin-flag external/odin-flag
```
From your project directory you can access the library like in the code below.
```odin
package main

import flag "external/odin-flag"

main :: proc() {
using flag

flag := flagset()

// ...

flag->free()
}
```
**NOTE:** the path to odin-flag may be different depending on where odin-flag is installed and where you are trying to access odin-flag from.
Your first step to troubleshoot installation issues is to check where odin-flag is installed and where you are trying to access odin-flag from.

## Contributing
If you wish to contribute new features, report/fix a bug, or discuss changes/additions to the product please create an issue.