提交 4ba74083 作者: Matt Bell

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

上级 052d387a
......@@ -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
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论