@@ -26,9 +26,11 @@ fn command() -> Command {
26
26
Command :: new ( "moss" )
27
27
. about ( "Next generation package manager" )
28
28
. arg (
29
- Arg :: new ( "version " )
29
+ Arg :: new ( "verbose " )
30
30
. short ( 'v' )
31
- . long ( "version" )
31
+ . long ( "verbose" )
32
+ . global ( true )
33
+ . help ( "Prints additional information about what moss is doing" )
32
34
. action ( ArgAction :: SetTrue ) ,
33
35
)
34
36
. arg (
@@ -77,9 +79,13 @@ pub fn process() -> Result<(), Error> {
77
79
let args = replace_aliases ( env:: args ( ) ) ;
78
80
let matches = command ( ) . get_matches_from ( args) ;
79
81
80
- if matches. get_flag ( "version" ) {
81
- version:: print ( ) ;
82
- return Ok ( ( ) ) ;
82
+ // Print the version, but not if the user is using the version subcommand
83
+ if matches. get_flag ( "verbose" ) {
84
+ if let Some ( command) = matches. subcommand_name ( ) {
85
+ if command != "version" {
86
+ version:: print ( ) ;
87
+ }
88
+ }
83
89
}
84
90
85
91
let root = matches. get_one :: < PathBuf > ( "root" ) . unwrap ( ) ;
@@ -105,8 +111,8 @@ pub fn process() -> Result<(), Error> {
105
111
Some ( ( "search" , args) ) => search:: handle ( args, installation) . map_err ( Error :: Search ) ,
106
112
Some ( ( "state" , args) ) => state:: handle ( args, installation) . map_err ( Error :: State ) ,
107
113
Some ( ( "sync" , args) ) => sync:: handle ( args, installation) . map_err ( Error :: Sync ) ,
108
- Some ( ( "version" , _ ) ) => {
109
- version:: print ( ) ;
114
+ Some ( ( "version" , args ) ) => {
115
+ version:: handle ( args ) ;
110
116
Ok ( ( ) )
111
117
}
112
118
None => {
0 commit comments