Skip to content

Commit b19893a

Browse files
committed
Update to latest clap 3.0.0-rc.7
1 parent 09c534f commit b19893a

File tree

3 files changed

+46
-103
lines changed

3 files changed

+46
-103
lines changed

Cargo.lock

Lines changed: 21 additions & 79 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
@@ -20,7 +20,7 @@ exclude = [
2020
]
2121

2222
[dependencies]
23-
clap = "3.0.0-beta.5"
23+
clap = "3.0.0-rc.7"
2424
dirs-next = "2"
2525
env_logger = "0.9"
2626
lazy_static = "1"

src/main.rs

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,12 @@ fn parse_args() -> Args {
9898

9999
let app = App::new(consts::PROGRAM_NAME)
100100
.version(version)
101-
.setting(clap::AppSettings::TrailingVarArg)
102101
.about(about)
102+
.setting(clap::AppSettings::TrailingVarArg)
103+
//.override_help(about)
103104
.arg(Arg::new("script")
104105
.index(1)
105-
.about("Script file or expression to execute.")
106+
.help("Script file or expression to execute.")
106107
.required_unless_present_any(if cfg!(windows) {
107108
vec!["clear-cache", "list-templates", "install-file-association", "uninstall-file-association"]
108109
} else {
@@ -116,14 +117,14 @@ fn parse_args() -> Args {
116117
.multiple_values(true)
117118
)
118119
.arg(Arg::new("expr")
119-
.about("Execute <script> as a literal expression and display the result.")
120+
.help("Execute <script> as a literal expression and display the result.")
120121
.long("expr")
121122
.short('e')
122123
.takes_value(false)
123124
.requires("script")
124125
)
125126
.arg(Arg::new("loop")
126-
.about("Execute <script> as a literal closure once for each line from stdin.")
127+
.help("Execute <script> as a literal closure once for each line from stdin.")
127128
.long("loop")
128129
.short('l')
129130
.takes_value(false)
@@ -136,51 +137,51 @@ fn parse_args() -> Args {
136137
Options that impact the script being executed.
137138
*/
138139
.arg(Arg::new("cargo-output")
139-
.about("Show output from cargo when building.")
140+
.help("Show output from cargo when building.")
140141
.short('o')
141142
.long("cargo-output")
142143
.requires("script")
143144
)
144145
.arg(Arg::new("count")
145-
.about("Invoke the loop closure with two arguments: line, and line number.")
146+
.help("Invoke the loop closure with two arguments: line, and line number.")
146147
.long("count")
147148
.requires("loop")
148149
)
149150
.arg(Arg::new("debug")
150-
.about("Build a debug executable, not an optimised one.")
151+
.help("Build a debug executable, not an optimised one.")
151152
.long("debug")
152153
)
153154
.arg(Arg::new("dep")
154-
.about("Add an additional Cargo dependency. Each SPEC can be either just the package name (which will assume the latest version) or a full `name=version` spec.")
155+
.help("Add an additional Cargo dependency. Each SPEC can be either just the package name (which will assume the latest version) or a full `name=version` spec.")
155156
.long("dep")
156157
.short('d')
157158
.takes_value(true)
158159
.multiple_occurrences(true)
159160
.number_of_values(1)
160161
)
161162
.arg(Arg::new("dep_extern")
162-
.about("Like `dep`, except that it *also* adds a `#[macro_use] extern crate name;` item for expression and loop scripts. Note that this only works if the name of the dependency and the name of the library it generates are exactly the same.")
163+
.help("Like `dep`, except that it *also* adds a `#[macro_use] extern crate name;` item for expression and loop scripts. Note that this only works if the name of the dependency and the name of the library it generates are exactly the same.")
163164
.long("dep-extern")
164165
.short('D')
165166
.takes_value(true)
166167
.multiple_occurrences(true)
167168
.requires("expr_or_loop")
168169
)
169170
.arg(Arg::new("extern")
170-
.about("Adds an `#[macro_use] extern crate name;` item for expressions and loop scripts.")
171+
.help("Adds an `#[macro_use] extern crate name;` item for expressions and loop scripts.")
171172
.long("extern")
172173
.short('x')
173174
.takes_value(true)
174175
.multiple_occurrences(true)
175176
.requires("expr_or_loop")
176177
)
177178
.arg(Arg::new("features")
178-
.about("Cargo features to pass when building and running.")
179+
.help("Cargo features to pass when building and running.")
179180
.long("features")
180181
.takes_value(true)
181182
)
182183
.arg(Arg::new("unstable_features")
183-
.about("Add a #![feature] declaration to the crate.")
184+
.help("Add a #![feature] declaration to the crate.")
184185
.long("unstable-feature")
185186
.short('u')
186187
.takes_value(true)
@@ -192,46 +193,46 @@ fn parse_args() -> Args {
192193
Options that change how rust-script itself behaves, and don't alter what the script will do.
193194
*/
194195
.arg(Arg::new("clear-cache")
195-
.about("Clears out the script cache.")
196+
.help("Clears out the script cache.")
196197
.long("clear-cache")
197198
)
198199
.arg(Arg::new("force")
199-
.about("Force the script to be rebuilt.")
200+
.help("Force the script to be rebuilt.")
200201
.long("force")
201202
.requires("script")
202203
)
203204
.arg(Arg::new("gen_pkg_only")
204-
.about("Generate the Cargo package, but don't compile or run it.")
205+
.help("Generate the Cargo package, but don't compile or run it.")
205206
.long("gen-pkg-only")
206207
.requires("script")
207208
.conflicts_with_all(&["debug", "force", "test", "bench"])
208209
)
209210
.arg(Arg::new("pkg_path")
210-
.about("Specify where to place the generated Cargo package.")
211+
.help("Specify where to place the generated Cargo package.")
211212
.long("pkg-path")
212213
.takes_value(true)
213214
.requires("script")
214215
.conflicts_with_all(&["clear-cache", "force"])
215216
)
216217
.arg(Arg::new("test")
217-
.about("Compile and run tests.")
218+
.help("Compile and run tests.")
218219
.long("test")
219220
.conflicts_with_all(&["bench", "debug", "force"])
220221
)
221222
.arg(Arg::new("bench")
222-
.about("Compile and run benchmarks. Requires a nightly toolchain.")
223+
.help("Compile and run benchmarks. Requires a nightly toolchain.")
223224
.long("bench")
224225
.conflicts_with_all(&["test", "debug", "force"])
225226
)
226227
.arg(Arg::new("template")
227-
.about("Specify a template to use for expression scripts.")
228+
.help("Specify a template to use for expression scripts.")
228229
.long("template")
229230
.short('t')
230231
.takes_value(true)
231232
.requires("expr")
232233
)
233234
.arg(Arg::new("toolchain-version")
234-
.about("Build the script using the given toolchain version.")
235+
.help("Build the script using the given toolchain version.")
235236
.long("toolchain-version")
236237
// "channel"
237238
.short('c')
@@ -240,7 +241,7 @@ fn parse_args() -> Args {
240241
.conflicts_with("bench")
241242
)
242243
.arg(Arg::new("list-templates")
243-
.about("List the available templates.")
244+
.help("List the available templates.")
244245
.long("list-templates")
245246
.takes_value(false)
246247
);
@@ -249,12 +250,12 @@ fn parse_args() -> Args {
249250
let app = app
250251
.arg(
251252
Arg::new("install-file-association")
252-
.about("Install a file association so that rust-script executes .ers files.")
253+
.help("Install a file association so that rust-script executes .ers files.")
253254
.long("install-file-association"),
254255
)
255256
.arg(
256257
Arg::new("uninstall-file-association")
257-
.about("Uninstall the file association that makes rust-script execute .ers files.")
258+
.help("Uninstall the file association that makes rust-script execute .ers files.")
258259
.long("uninstall-file-association"),
259260
)
260261
.group(

0 commit comments

Comments
 (0)