@cryptotaxi247 / kubo / commits / 4ba740836

commands: Don't error on file arg checking (for now)

Matt Bell committed Nov 16, 2014 at 01:10 UTC 4ba740836381043bfcfd9d66d084683784562c79
1 file changed +4 -1
commands/command.go
+4 -1
@@ -195,6 +195,9 @@ func (c *Command) GetOptions(path []string) (map[string]Option, error) {
195 }
196
197 func (c *Command) CheckArguments(req Request) error {
198 +
199 + // TODO: check file arguments
200 +
201 args := req.Arguments()
202 argDefs := c.Arguments
203
@@ -217,7 +220,7 @@ func (c *Command) CheckArguments(req Request) error {
220 valueIndex := 0 // the index of the current value (in `args`)
221 for _, argDef := range c.Arguments {
222 // skip optional argument definitions if there aren't sufficient remaining values
220 - if len(args)-valueIndex <= numRequired && !argDef.Required {
223 + if len(args)-valueIndex <= numRequired && !argDef.Required || argDef.Type == ArgFile {
224 continue
225 }
226