# A simple to use, efficient, Command Line Argument Parser
[](https://crates.io/crates/cok)
[](https://gitlab.com/andrew_ryan/cok)
[](https://gitlab.com/andrew_ryan/cok/-/raw/master/LICENSE)
## Example
create cli.json
```json
{
"name":"get",
"version":"0.1.1",
"authors":["Anonymous <dnrops@anonymous.com>"],
"about":"A git cli",
"args":[
{
"arg":"--init",
"short":"-i",
"required":true,
"about":"git init",
"takes_value":true
},
{
"arg":"--add",
"short":"-a",
"required":true,
"about":"git add",
"takes_value":true
},
{
"arg":"--commit",
"short":"-c",
"required":true,
"about":"the file type",
"takes_value":true,
"subcommands":[
{
"arg":"--commit",
"short":"-m",
"required":false,
"about":"commit msg",
"takes_value":true
}
]
},
{
"arg":"--push",
"short":"-p",
"required":true,
"about":"git push",
"takes_value":true
}
]
}
```
```
cargo add cok
```
main.rs
```rust
#[allow(warnings)]
fn main() {
use cok::cli::Cli;
Cli::load_from_json("./cli.json");
let args = Cli::args();
}
```
a simple cli
```
get 0.1.1
Anonymous <dnrops@anonymous.com>
A git cli
USAGE:
OPTION REQUIRED ABOUT
get -i --init true git init
get -a --add true git add
get -c --commit true the file type
get -p --push true git push
get -h --help Prints help information
SUBCOMMANDS:
OPTION SUBCOMMAND REQUIRED ABOUT
get -c --commit -m --commit false commit msg
```