You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.help("print verbose information for each processing step"),
273
285
)
274
286
.arg(
275
-
Arg::new("split-string")// split string handling is implemented directly, not using CLAP. But this entry here is needed for the help information output.
287
+
Arg::new(options::SPLIT_STRING)// split string handling is implemented directly, not using CLAP. But this entry here is needed for the help information output.
276
288
.short('S')
277
-
.long("split-string")
289
+
.long(options::SPLIT_STRING)
278
290
.value_name("S")
279
291
.action(ArgAction::Set)
280
292
.value_parser(ValueParser::os_string())
281
293
.help("process and split S into separate arguments; used to pass multiple arguments on shebang lines")
282
294
).arg(
283
-
Arg::new("argv0")
284
-
.overrides_with("argv0")
295
+
Arg::new(options::ARGV0)
296
+
.overrides_with(options::ARGV0)
285
297
.short('a')
286
-
.long("argv0")
298
+
.long(options::ARGV0)
287
299
.value_name("a")
288
300
.action(ArgAction::Set)
289
301
.value_parser(ValueParser::os_string())
@@ -296,8 +308,8 @@ pub fn uu_app() -> Command {
296
308
.value_parser(ValueParser::os_string())
297
309
)
298
310
.arg(
299
-
Arg::new("ignore-signal")
300
-
.long("ignore-signal")
311
+
Arg::new(options::IGNORE_SIGNAL)
312
+
.long(options::IGNORE_SIGNAL)
301
313
.value_name("SIG")
302
314
.action(ArgAction::Append)
303
315
.value_parser(ValueParser::os_string())
@@ -387,7 +399,31 @@ impl EnvAppData {
387
399
original_args:&Vec<OsString>,
388
400
) -> UResult<Vec<OsString>>{
389
401
letmut all_args:Vec<OsString> = Vec::new();
390
-
for arg in original_args {
402
+
letmut process_flags = true;
403
+
letmut expecting_arg = false;
404
+
// Leave out split-string since it's a special case below
405
+
let flags_with_args = [
406
+
options::ARGV0,
407
+
options::CHDIR,
408
+
options::FILE,
409
+
options::IGNORE_SIGNAL,
410
+
options::UNSET,
411
+
];
412
+
let short_flags_with_args = ['a','C','f','u'];
413
+
for(n, arg)in original_args.iter().enumerate(){
414
+
let arg_str = arg.to_string_lossy();
415
+
// Stop processing env flags once we reach the command or -- argument
0 commit comments