File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ version = "0.8"
8484[dependencies .clap ]
8585version = " 4.4"
8686optional = true
87- features = [" derive" , " string" , " wrap_help" ]
87+ features = [" color " , " derive" , " string" , " wrap_help" ]
8888
8989[dependencies .mlua ]
9090workspace = true
Original file line number Diff line number Diff line change 1- use sile:: cli:: Cli ;
1+ use sile:: cli:: { Cli , STYLES } ;
22
33use snafu:: prelude:: * ;
44
@@ -34,7 +34,10 @@ fn main() -> Result<()> {
3434 . strip_prefix ( "SILE " )
3535 . unwrap_or ( "" )
3636 . to_string ( ) ;
37- let app = Cli :: command ( ) . version ( version) . long_version ( long_version) ;
37+ let app = Cli :: command ( )
38+ . version ( version)
39+ . long_version ( long_version)
40+ . styles ( STYLES ) ;
3841 let matches = app. get_matches ( ) ;
3942 let args = Cli :: from_arg_matches ( & matches) . context ( ArgsSnafu ) ?;
4043 sile:: run (
Original file line number Diff line number Diff line change 1+ use clap:: builder:: styling:: { AnsiColor , Styles } ;
12use clap:: Parser ;
23use std:: path:: PathBuf ;
34
@@ -146,3 +147,12 @@ pub struct Cli {
146147 #[ clap( short, long) ]
147148 pub traceback : bool ,
148149}
150+
151+ pub const STYLES : Styles = Styles :: styled ( )
152+ . header ( AnsiColor :: Magenta . on_default ( ) . bold ( ) )
153+ . usage ( AnsiColor :: Yellow . on_default ( ) . bold ( ) )
154+ . literal ( AnsiColor :: BrightCyan . on_default ( ) . bold ( ) )
155+ . placeholder ( AnsiColor :: Cyan . on_default ( ) )
156+ . error ( AnsiColor :: BrightRed . on_default ( ) . bold ( ) )
157+ . valid ( AnsiColor :: BrightGreen . on_default ( ) . bold ( ) )
158+ . invalid ( AnsiColor :: BrightYellow . on_default ( ) . bold ( ) ) ;
You can’t perform that action at this time.
0 commit comments