Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/beastmatser/cli
- Owner: beastmatser
- License: mit
- Created: 2022-04-14T15:05:49.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-12-05T11:23:27.000Z (11 months ago)
- Last Synced: 2024-08-02T14:08:47.025Z (3 months ago)
- Topics: cli, odin
- Language: Odin
- Homepage:
- Size: 47.9 KB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cli
A simple package to build command line apps in Odin.
## An example
```odin
package mainimport "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!
```