Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/beastmatser/cli

A simple cli tool for Odin
https://github.com/beastmatser/cli

cli odin

Last synced: 8 days ago
JSON representation

A simple cli tool for Odin

Awesome Lists containing this project

README

        

# cli

A simple package to build command line apps in Odin.

## An example

```odin
package main

import "cli"
import "core:fmt"
import "core:strings"

action :: proc(app: cli.App, manager: cli.Manager) {
fmt.println(strings.join(manager.args[2:], " "))
}

main :: proc() {
app := cli.App {
description = "This is my simple cli tool!",
}

cli.add(&app, &cli.Command{name = "echo", action = action})
err := cli.run(&app)
}
```

To use your cli compile your code and move it into your path,
it should look something like this:
```
odin run app.odin -file -out:app
app echo Hello World!
> Hello World!
```