toiletcli
A framework for command line applications, including a command line argument parser.
Complete overview can be found in the documentation for each module.
Modules can be disabled/enabled via features:
[]
= ["flags", "colors", "escapes"]
Examples
//! Command line argument parsing.
use args;
use flags;
use ;
let mut args = args;
// Most often, path to the program will be the first argument.
// This will prevent the function from parsing, as path to the program does not start with '-'.
let program_name = args.next.unwrap;
let mut v_flag;
let mut main_flags = flags!;
let subcommand = parse_flags_until_subcommand.unwrap;
let mut d_flag;
let mut sub_flags = flags!;
let subcommand_args = parse_flags;
//! Convenient ANSI terminal colors and styles.
use ;
println!;
let weird_style = new
.foreground
.background
.add_style
.underline_color
.underline_style
.build;
println!;
//! Most common escapes to manipulate terminals.
use ;
println!;
// This is a 'bird' that will be replaced!
println!;
// This is a 'cat' that will be replaced too!
print!;
// Look at the title :3
//! Common functions.
use ;
let path = "toilet/bin/program";
let name = name_from_path;
assert_eq!;