@@ -5,7 +5,7 @@ use volta_core::error::{ExitCode, Fallible};
55use volta_core:: session:: Session ;
66
77#[ derive( Parser ) ]
8- #[ clap (
8+ #[ command (
99 name = "Volta" ,
1010 about = "The JavaScript Launcher ⚡" ,
1111 long_about = "The JavaScript Launcher ⚡
@@ -14,16 +14,15 @@ use volta_core::session::Session;
1414 To pin your project's runtime or package manager, use `volta pin`." ,
1515 color = clap:: ColorChoice :: Auto ,
1616 disable_version_flag = true ,
17- dont_collapse_args_in_usage = true ,
1817) ]
1918pub ( crate ) struct Volta {
20- #[ clap ( subcommand) ]
19+ #[ command ( subcommand) ]
2120 pub ( crate ) command : Option < Subcommand > ,
2221
23- #[ clap ( long = "verbose" , help = "Enables verbose diagnostics" , global = true ) ]
22+ #[ arg ( long = "verbose" , help = "Enables verbose diagnostics" , global = true ) ]
2423 pub ( crate ) verbose : bool ,
2524
26- #[ clap (
25+ #[ arg (
2726 long = "quiet" ,
2827 help = "Prevents unnecessary output" ,
2928 global = true ,
@@ -32,7 +31,7 @@ pub(crate) struct Volta {
3231 ) ]
3332 pub ( crate ) quiet : bool ,
3433
35- #[ clap (
34+ #[ arg (
3635 short = 'v' ,
3736 long = "version" ,
3837 help = "Prints the current version of Volta"
@@ -61,27 +60,27 @@ impl Volta {
6160#[ derive( clap:: Subcommand ) ]
6261pub ( crate ) enum Subcommand {
6362 /// Fetches a tool to the local machine
64- #[ clap ( name = "fetch" ) ]
63+ #[ command ( name = "fetch" ) ]
6564 Fetch ( command:: Fetch ) ,
6665
6766 /// Installs a tool in your toolchain
68- #[ clap ( name = "install" ) ]
67+ #[ command ( name = "install" ) ]
6968 Install ( command:: Install ) ,
7069
7170 /// Uninstalls a tool from your toolchain
72- #[ clap ( name = "uninstall" ) ]
71+ #[ command ( name = "uninstall" ) ]
7372 Uninstall ( command:: Uninstall ) ,
7473
7574 /// Pins your project's runtime or package manager
76- #[ clap ( name = "pin" ) ]
75+ #[ command ( name = "pin" ) ]
7776 Pin ( command:: Pin ) ,
7877
7978 /// Displays the current toolchain
80- #[ clap ( name = "list" , alias = "ls" ) ]
79+ #[ command ( name = "list" , alias = "ls" ) ]
8180 List ( command:: List ) ,
8281
8382 /// Generates Volta completions
84- #[ clap (
83+ #[ command (
8584 name = "completions" ,
8685 arg_required_else_help = true ,
8786 long_about = "Generates Volta completions
@@ -97,22 +96,22 @@ otherwise, they will be written to `stdout`.
9796 Completions ( command:: Completions ) ,
9897
9998 /// Locates the actual binary that will be called by Volta
100- #[ clap ( name = "which" ) ]
99+ #[ command ( name = "which" ) ]
101100 Which ( command:: Which ) ,
102101
103- #[ clap (
102+ #[ command (
104103 name = "use" ,
105104 long_about = crate :: command:: r#use:: USAGE ,
106105 hide = true ,
107106 ) ]
108107 Use ( command:: Use ) ,
109108
110109 /// Enables Volta for the current user / shell
111- #[ clap ( name = "setup" ) ]
110+ #[ command ( name = "setup" ) ]
112111 Setup ( command:: Setup ) ,
113112
114113 /// Run a command with custom Node, npm, pnpm, and/or Yarn versions
115- #[ clap ( name = "run" , allow_hyphen_values = true , trailing_var_arg = true ) ]
114+ #[ command ( name = "run" ) ]
116115 Run ( command:: Run ) ,
117116}
118117
0 commit comments