File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11use clap:: Parser ;
22use clap:: Subcommand ;
3+ use clap:: builder:: Styles ;
4+ use clap:: builder:: styling:: { AnsiColor , Effects } ;
35use std:: path:: PathBuf ;
46
57use crate :: logging;
68
9+ // Configures Clap v3-style help menu colors
10+ const STYLES : Styles = Styles :: styled ( )
11+ . header ( AnsiColor :: Green . on_default ( ) . effects ( Effects :: BOLD ) )
12+ . usage ( AnsiColor :: Green . on_default ( ) . effects ( Effects :: BOLD ) )
13+ . literal ( AnsiColor :: Cyan . on_default ( ) . effects ( Effects :: BOLD ) )
14+ . placeholder ( AnsiColor :: Cyan . on_default ( ) ) ;
15+
716#[ derive( Parser ) ]
817#[ command(
918 author,
@@ -12,6 +21,7 @@ use crate::logging;
1221 after_help = "For help with a specific command, see: `air help <command>`."
1322) ]
1423#[ command( version) ]
24+ #[ command( styles = STYLES ) ]
1525pub struct Args {
1626 #[ command( subcommand) ]
1727 pub ( crate ) command : Command ,
You can’t perform that action at this time.
0 commit comments