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
f6281e5a
Commit
f6281e5a
authored
Nov 11, 2014
by
Matt Bell
Committed by
Juan Batiz-Benet
Nov 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands/http: s/lenRequired/numRequired/
parent
24b64654
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
http/parse.go
http/parse.go
+4
-4
No files found.
http/parse.go
View file @
f6281e5a
...
...
@@ -42,10 +42,10 @@ func Parse(r *http.Request, root *cmds.Command) (cmds.Request, error) {
args
:=
make
([]
interface
{},
0
)
// count required argument definitions
len
Required
:=
0
num
Required
:=
0
for
_
,
argDef
:=
range
cmd
.
Arguments
{
if
argDef
.
Required
{
len
Required
++
num
Required
++
}
}
...
...
@@ -58,10 +58,10 @@ func Parse(r *http.Request, root *cmds.Command) (cmds.Request, error) {
for
_
,
argDef
:=
range
cmd
.
Arguments
{
// skip optional argument definitions if there aren't sufficient remaining values
if
valCount
<=
len
Required
&&
!
argDef
.
Required
{
if
valCount
<=
num
Required
&&
!
argDef
.
Required
{
continue
}
else
if
argDef
.
Required
{
len
Required
--
num
Required
--
}
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