Commit 4ba74083 authored by Matt Bell's avatar Matt Bell

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

parent 052d387a
...@@ -195,6 +195,9 @@ func (c *Command) GetOptions(path []string) (map[string]Option, error) { ...@@ -195,6 +195,9 @@ func (c *Command) GetOptions(path []string) (map[string]Option, error) {
} }
func (c *Command) CheckArguments(req Request) error { func (c *Command) CheckArguments(req Request) error {
// TODO: check file arguments
args := req.Arguments() args := req.Arguments()
argDefs := c.Arguments argDefs := c.Arguments
...@@ -217,7 +220,7 @@ func (c *Command) CheckArguments(req Request) error { ...@@ -217,7 +220,7 @@ func (c *Command) CheckArguments(req Request) error {
valueIndex := 0 // the index of the current value (in `args`) valueIndex := 0 // the index of the current value (in `args`)
for _, argDef := range c.Arguments { for _, argDef := range c.Arguments {
// skip optional argument definitions if there aren't sufficient remaining values // 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 continue
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment