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-unixfs
Commits
4ba74083
Commit
4ba74083
authored
Nov 16, 2014
by
Matt Bell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands: Don't error on file arg checking (for now)
parent
052d387a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
commands/command.go
commands/command.go
+4
-1
No files found.
commands/command.go
View file @
4ba74083
...
...
@@ -195,6 +195,9 @@ func (c *Command) GetOptions(path []string) (map[string]Option, error) {
}
func
(
c
*
Command
)
CheckArguments
(
req
Request
)
error
{
// TODO: check file arguments
args
:=
req
.
Arguments
()
argDefs
:=
c
.
Arguments
...
...
@@ -217,7 +220,7 @@ func (c *Command) CheckArguments(req Request) error {
valueIndex
:=
0
// the index of the current value (in `args`)
for
_
,
argDef
:=
range
c
.
Arguments
{
// skip optional argument definitions if there aren't sufficient remaining values
if
len
(
args
)
-
valueIndex
<=
numRequired
&&
!
argDef
.
Required
{
if
len
(
args
)
-
valueIndex
<=
numRequired
&&
!
argDef
.
Required
||
argDef
.
Type
==
ArgFile
{
continue
}
...
...
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