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
2f947d71
Commit
2f947d71
authored
Nov 05, 2014
by
Matt Bell
Committed by
Juan Batiz-Benet
Nov 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands: Fixed parser argument bug (TODO: better test coverage for command parsers)
parent
792b122f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
cli/parse.go
cli/parse.go
+2
-0
http/parse.go
http/parse.go
+2
-0
No files found.
cli/parse.go
View file @
2f947d71
...
...
@@ -132,6 +132,8 @@ func parseArgs(stringArgs []string, cmd *cmds.Command) ([]interface{}, error) {
// skip optional argument definitions if there aren't sufficient remaining values
if
len
(
stringArgs
)
-
j
<=
lenRequired
&&
!
argDef
.
Required
{
continue
}
else
if
argDef
.
Required
{
lenRequired
--
}
if
j
>=
len
(
stringArgs
)
{
...
...
http/parse.go
View file @
2f947d71
...
...
@@ -60,6 +60,8 @@ func Parse(r *http.Request, root *cmds.Command) (cmds.Request, error) {
// skip optional argument definitions if there aren't sufficient remaining values
if
valCount
<=
lenRequired
&&
!
argDef
.
Required
{
continue
}
else
if
argDef
.
Required
{
lenRequired
--
}
if
argDef
.
Type
==
cmds
.
ArgString
{
...
...
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