diff options
author | Nick Thomas <nick@gitlab.com> | 2021-09-08 10:06:06 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2021-09-08 10:06:06 +0000 |
commit | 7884a4420ac8ffd3ee34589c0f8e0d25ca0fd076 (patch) | |
tree | 612c450010837d2dde0f11446c4cbe79bc20af49 /internal/command/command.go | |
parent | 07bbfd279bc236229d95942372370b955db08b75 (diff) | |
parent | 8b4621aa6cba1674192ffb6e3c3e801a567f2516 (diff) | |
download | gitlab-shell-7884a4420ac8ffd3ee34589c0f8e0d25ca0fd076.tar.gz |
Merge branch 'remove/generic-args' into 'main'
refactor: remove commandargs.GenericArgs
Closes #212
See merge request gitlab-org/gitlab-shell!506
Diffstat (limited to 'internal/command/command.go')
-rw-r--r-- | internal/command/command.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/internal/command/command.go b/internal/command/command.go index 6696f0f..dadf41a 100644 --- a/internal/command/command.go +++ b/internal/command/command.go @@ -29,9 +29,13 @@ type Command interface { } func New(e *executable.Executable, arguments []string, env sshenv.Env, config *config.Config, readWriter *readwriter.ReadWriter) (Command, error) { - args, err := commandargs.Parse(e, arguments, env) - if err != nil { - return nil, err + var args commandargs.CommandArgs + if e.AcceptArgs { + var err error + args, err = commandargs.Parse(e, arguments, env) + if err != nil { + return nil, err + } } if cmd := buildCommand(e, args, config, readWriter); cmd != nil { |