terminal_demo/
terminal_demo.rs1use flag_rs::{CommandBuilder, Flag, FlagType, FlagValue};
16
17fn main() {
18 let app = CommandBuilder::new("demo")
19 .short("Terminal feature demonstration")
20 .long("This application demonstrates the terminal width detection and text wrapping features. The help text should automatically adjust to your terminal width, wrapping long lines at word boundaries while maintaining readability. Try running this with different COLUMNS values to see how it adapts.")
21 .flag(
22 Flag::new("file")
23 .short('f')
24 .usage("Input file path. This flag expects a path to a file that will be processed. The file must exist and be readable.")
25 .value_type(FlagType::String)
26 )
27 .flag(
28 Flag::new("output-format")
29 .short('o')
30 .usage("Output format for results. Supported formats include: json (machine-readable JSON format), yaml (human-friendly YAML format), table (formatted ASCII table), csv (comma-separated values for spreadsheet import)")
31 .value_type(FlagType::String)
32 .default(FlagValue::String("table".to_string()))
33 )
34 .subcommand(
35 CommandBuilder::new("process")
36 .short("Process data with various transformations and filters that can be applied in sequence")
37 .build()
38 )
39 .build();
40
41 app.print_help();
43}