Skip to content

Commit 196e4af

Browse files
committed
chore: update to structopt 0.3.26
1 parent 75581e5 commit 196e4af

File tree

6 files changed

+72
-87
lines changed

6 files changed

+72
-87
lines changed

Cargo.lock

Lines changed: 46 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ serde_json = "1.0.111"
2727
lazy_static = "1.3.0"
2828
log = { version = "0.4", features = ["std"] }
2929
node-semver = "2"
30-
structopt = "0.2.14"
30+
structopt = "0.3.26"
3131
cfg-if = "1.0"
3232
mockito = { version = "0.31.1", optional = true }
3333
test-support = { path = "crates/test-support" }

src/cli.rs

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,16 @@ use volta_core::session::Session;
88
#[structopt(
99
name = "Volta",
1010
about = "The JavaScript Launcher ⚡",
11-
author = "",
1211
long_about = "The JavaScript Launcher ⚡
1312
1413
To install a tool in your toolchain, use `volta install`.
1514
To pin your project's runtime or package manager, use `volta pin`.",
16-
raw(global_setting = "structopt::clap::AppSettings::ColoredHelp"),
17-
raw(global_setting = "structopt::clap::AppSettings::ColorAuto"),
18-
raw(global_setting = "structopt::clap::AppSettings::DeriveDisplayOrder"),
19-
raw(global_setting = "structopt::clap::AppSettings::DisableVersion"),
20-
raw(global_setting = "structopt::clap::AppSettings::DontCollapseArgsInUsage"),
21-
raw(global_setting = "structopt::clap::AppSettings::VersionlessSubcommands")
15+
global_setting = structopt::clap::AppSettings::ColoredHelp,
16+
global_setting = structopt::clap::AppSettings::ColorAuto,
17+
global_setting = structopt::clap::AppSettings::DeriveDisplayOrder,
18+
global_setting = structopt::clap::AppSettings::DisableVersion,
19+
global_setting = structopt::clap::AppSettings::DontCollapseArgsInUsage,
20+
global_setting = structopt::clap::AppSettings::VersionlessSubcommands
2221
)]
2322
pub(crate) struct Volta {
2423
#[structopt(subcommand)]
@@ -32,7 +31,7 @@ pub(crate) struct Volta {
3231
help = "Prevents unnecessary output",
3332
global = true,
3433
conflicts_with = "verbose",
35-
raw(aliases = r#"&["silent"]"#)
34+
aliases = &["silent"]
3635
)]
3736
pub(crate) quiet: bool,
3837

@@ -65,31 +64,29 @@ impl Volta {
6564
#[derive(StructOpt)]
6665
pub(crate) enum Subcommand {
6766
/// Fetches a tool to the local machine
68-
#[structopt(name = "fetch", author = "", version = "")]
67+
#[structopt(name = "fetch")]
6968
Fetch(command::Fetch),
7069

7170
/// Installs a tool in your toolchain
72-
#[structopt(name = "install", author = "", version = "")]
71+
#[structopt(name = "install")]
7372
Install(command::Install),
7473

7574
/// Uninstalls a tool from your toolchain
76-
#[structopt(name = "uninstall", author = "", version = "")]
75+
#[structopt(name = "uninstall")]
7776
Uninstall(command::Uninstall),
7877

7978
/// Pins your project's runtime or package manager
80-
#[structopt(name = "pin", author = "", version = "")]
79+
#[structopt(name = "pin")]
8180
Pin(command::Pin),
8281

8382
/// Displays the current toolchain
84-
#[structopt(name = "list", alias = "ls", author = "", version = "")]
83+
#[structopt(name = "list", alias = "ls")]
8584
List(command::List),
8685

8786
/// Generates Volta completions
8887
#[structopt(
8988
name = "completions",
90-
author = "",
91-
version = "",
92-
raw(setting = "structopt::clap::AppSettings::ArgRequiredElseHelp"),
89+
setting = structopt::clap::AppSettings::ArgRequiredElseHelp,
9390
long_about = "Generates Volta completions
9491
9592
By default, completions will be generated for the value of your current shell,
@@ -103,29 +100,26 @@ otherwise, they will be written to `stdout`.
103100
Completions(command::Completions),
104101

105102
/// Locates the actual binary that will be called by Volta
106-
#[structopt(name = "which", author = "", version = "")]
103+
#[structopt(name = "which")]
107104
Which(command::Which),
108105

109106
#[structopt(
110107
name = "use",
111-
author = "",
112-
version = "",
113-
template = "{usage}",
114-
raw(
115-
usage = "crate::command::r#use::USAGE",
116-
setting = "structopt::clap::AppSettings::Hidden"
117-
)
108+
long_about = crate::command::r#use::USAGE,
109+
setting = structopt::clap::AppSettings::Hidden,
118110
)]
119111
Use(command::Use),
120112

121113
/// Enables Volta for the current user / shell
122-
#[structopt(name = "setup", author = "", version = "")]
114+
#[structopt(name = "setup")]
123115
Setup(command::Setup),
124116

125117
/// Run a command with custom Node, npm, pnpm, and/or Yarn versions
126-
#[structopt(name = "run", author = "", version = "")]
127-
#[structopt(raw(setting = "structopt::clap::AppSettings::AllowLeadingHyphen"))]
128-
#[structopt(raw(setting = "structopt::clap::AppSettings::TrailingVarArg"))]
118+
#[structopt(
119+
name = "run",
120+
setting = structopt::clap::AppSettings::AllowLeadingHyphen,
121+
setting = structopt::clap::AppSettings::TrailingVarArg,
122+
)]
129123
Run(command::Run),
130124
}
131125

src/command/completions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub(crate) struct Completions {
1717
#[structopt(
1818
takes_value = true,
1919
index = 1,
20-
raw(possible_values = "&Shell::variants()"),
20+
possible_values = &Shell::variants(),
2121
case_insensitive = true
2222
)]
2323
shell: Shell,

src/command/list/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ pub(crate) struct List {
212212
/// Specify the output format.
213213
///
214214
/// Defaults to `human` for TTYs, `plain` otherwise.
215-
#[structopt(long = "format", raw(possible_values = r#"&["human", "plain"]"#))]
215+
#[structopt(long = "format", possible_values = &["human", "plain"])]
216216
format: Option<Format>,
217217

218218
/// Show the currently-active tool(s).

src/command/run.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub(crate) struct Run {
4242
no_yarn: bool,
4343

4444
/// Set an environment variable (can be used multiple times)
45-
#[structopt(long = "env", value_name = "NAME=value", raw(number_of_values = "1"))]
45+
#[structopt(long = "env", value_name = "NAME=value", number_of_values = 1)]
4646
envs: Vec<String>,
4747

4848
#[structopt(parse(from_os_str))]

0 commit comments

Comments
 (0)