# 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":"cargo",
"version":"1.0.0",
"authors":["andrew <dnrops@anonymous.com>","ryan <rysn@gmail.com>"],
"description":"Rust's package manager",
"options":[
{
"name":"--version",
"short":"V",
"description":"Print version info and exit"
},
{
"name":"--offline",
"description":"Run without accessing the network"
}
],
"commands":[
{
"name":"build",
"short":"b",
"description":"Compile the current package"
},
{
"name":"check",
"short":"c",
"description":"Analyze the current package and report errors, but don't build object files"
},
{
"name":"clean",
"description":"Remove the target directory"
},
{
"name":"new",
"description":"Create a new cargo package"
},
{
"name":"add",
"description":"Add dependencies to a manifest file"
}
]
}
```
```
cargo add cok
```
main.rs
```rust
fn main() {
use cok::cli::Cli;
let json = include_str!("../cli.json");
let args = Cli::new()
.load_from_json(json)
.args();
}
```
a simple cli
```
cargo 1.0.0
andrew <dnrops@anonymous.com>,ryan <rysn@gmail.com>
Rust's package manager
Usage: cargo [OPTIONS] [COMMAND]
Options:
cargo build, b Compile the current package
cargo check, c Analyze the current package and report errors, but don't build object files
cargo clean Remove the target directory
cargo new Create a new cargo package
cargo add Add dependencies to a manifest file
Commands:
cargo build, b Compile the current package
cargo check, c Analyze the current package and report errors, but don't build object files
cargo clean Remove the target directory
cargo new Create a new cargo package
cargo add Add dependencies to a manifest file
cargo -h --help Prints help information
```