Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3-cmds
Commits
883b7c7d
Commit
883b7c7d
authored
Nov 19, 2014
by
Matt Bell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands/cli: Only allow recursive paths if -r option definition is OptionRecursivePath
parent
83d1df5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
cli/parse.go
cli/parse.go
+10
-3
No files found.
cli/parse.go
View file @
883b7c7d
...
...
@@ -46,10 +46,17 @@ func Parse(input []string, stdin *os.File, root *cmds.Command) (cmds.Request, *c
return
nil
,
cmd
,
path
,
err
}
recursive
,
_
,
err
:=
req
.
Option
(
cmds
.
RecShort
)
.
Bool
()
if
err
!=
nil
{
return
nil
,
nil
,
nil
,
u
.
ErrCast
()
// if -r is provided, and it is associated with the package builtin
// recursive path option, allow recursive file paths
recursiveOpt
:=
req
.
Option
(
cmds
.
RecShort
)
recursive
:=
false
if
recursiveOpt
!=
nil
&&
recursiveOpt
.
Definition
()
==
cmds
.
OptionRecursivePath
{
recursive
,
_
,
err
=
recursiveOpt
.
Bool
()
if
err
!=
nil
{
return
nil
,
nil
,
nil
,
u
.
ErrCast
()
}
}
stringArgs
,
fileArgs
,
err
:=
parseArgs
(
stringVals
,
stdin
,
cmd
.
Arguments
,
recursive
)
if
err
!=
nil
{
return
nil
,
cmd
,
path
,
err
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment