argone


Most intuitive global cli maker. *(lazy_static + config-rs + clap)

CI Crates.io Licensed Twitter

| Docs | Latest Note |

toml [dependencies] argone = "0.1"


Phases

  1. Clap Parse
  2. Clap None &\& [Config] marked -> Extract from Config
  3. Config None -> set Default(=)

Example

```rust use argone::{ARGS, COMMANDS};

ARGS! { version = "0.1" author = "just-do-halee just.do.halee@gmail.com"

Config {
    file = "loxconfig"
    prefix = "LOX"
    panic = ("couldn't find {} file.", "loxconfig")
}

Args {
    /// Root directory
    [Config] rootDir: Option<PathBuf> = argone::CURRENT_DIR.clone()

    /// Sets a custom config file
    #[clap(short, long, default_value = "test")]
    name: String

    /// A level of verbosity, and can be used multiple times
    #[clap(short, long, parse(from_occurrences))]
    verbose: u8
}

commands = Sub

}

COMMANDS! { Sub {

    /// first
    First {
        version = "1.0"
        author = "just-do-halee <just.do.halee@gmail.com>"
        Args {
            /// Test String
            test: String
        }
    }

    /// second
    Second {
        Args {
            // Test u8
            test: u8
        }
    }

}

}

println!("{:#?}", *ARGS); ```