File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -20,9 +20,11 @@ use plib::PROJECT_NAME;
2020
2121#[ derive( Parser ) ]
2222#[ command(
23- version,
2423 about = gettext( "time - time a simple command or give resource usage" ) ,
25- help_template = gettext( "{about-with-newline}\n Usage: {usage}\n \n Arguments:\n {positionals}\n \n Options:\n {options}" )
24+ help_template = gettext( "{about}\n \n Usage: {usage}\n \n Arguments:\n {positionals}\n \n Options:\n {options}" ) ,
25+ version = env!( "CARGO_PKG_VERSION" ) ,
26+ disable_help_flag = true ,
27+ disable_version_flag = true ,
2628) ]
2729struct Args {
2830 #[ arg(
@@ -41,6 +43,12 @@ struct Args {
4143 help = gettext( "Arguments for the utility" )
4244 ) ]
4345 arguments : Vec < String > ,
46+
47+ #[ arg( short, long, help = gettext( "Print help" ) , action = clap:: ArgAction :: HelpLong ) ]
48+ help : bool ,
49+
50+ #[ arg( short = 'V' , long, help = gettext( "Print version" ) , action = clap:: ArgAction :: Version ) ]
51+ version : bool ,
4452}
4553
4654enum TimeError {
You can’t perform that action at this time.
0 commit comments