Adds the proper workarounds for short flags (#4794)

This commit is contained in:
JT 2022-03-09 08:04:50 -05:00 committed by GitHub
parent 925e9f4dcb
commit 0835073d85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -98,14 +98,10 @@ fn main() -> Result<()> {
if arg == "-c" if arg == "-c"
|| arg == "--commands" || arg == "--commands"
|| arg == "--testbin" || arg == "--testbin"
|| arg == "--develop"
|| arg == "--debug"
|| arg == "--loglevel"
|| arg == "--config"
|| arg == "--perf"
|| arg == "--threads"
|| arg == "--version"
|| arg == "--log-level" || arg == "--log-level"
|| arg == "--config"
|| arg == "--threads"
|| arg == "-t"
{ {
collect_arg_nushell = true; collect_arg_nushell = true;
} }
@ -383,11 +379,6 @@ impl Command for Nu {
"run the given commands and then exit", "run the given commands and then exit",
Some('c'), Some('c'),
) )
.optional(
"script file",
SyntaxShape::Filepath,
"name of the optional script file to run",
)
.named( .named(
"config", "config",
SyntaxShape::String, SyntaxShape::String,
@ -406,6 +397,11 @@ impl Command for Nu {
"threads to use for parallel commands", "threads to use for parallel commands",
Some('t'), Some('t'),
) )
.optional(
"script file",
SyntaxShape::Filepath,
"name of the optional script file to run",
)
.rest( .rest(
"script args", "script args",
SyntaxShape::String, SyntaxShape::String,