QuiCLI
Quickly build cool CLI apps in Rust.
Get started
-
Create a new Rust binary project called "head" with
cargo new --bin head
. -
Add quicli as an dependency in your
Cargo.toml
:[] = "0.1"
And, to be able to use all the features, also add these two goodies:
= "0.1" = "1"
-
Now, open up your
src/main.rs
. Let's import all the good stuff:extern crate quicli; use *;
That's it. That's all the imports you should need for now.
-
Now, quickly write a cool CLI (it's also okay to type slowly):
// Add cool slogan for your app here, e.g.: /// Get first n lines of a file main!;
-
Give it a spin!
cargo run
it! Did you see a nice error?- What does
cargo run -- Cargo.toml
show you? - How about
cargo run -- Cargo.toml --count=4
orcargo run -- Cargo.toml -n 2
? cargo run -- --help
-- how cool is that?- More fun: Try
--cont 4
(with the missing u). - You like log messages? That's what we added the
verbosity
field for! Givecargo run -- Cargo.toml -vv
a try!
Thanks
This is only possible because of all the awesome libraries included here:
- Structopt and Clap for the nice CLI with awesome argument handling, great error messages, and nice composability!
- Serde for handling all things serializing and deserializing
- failure for ergonomic error handling.
- …and more to come!
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.