1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-19 18:05:32 +08:00

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

This commit is contained in:
Matt Bell
2014-11-16 01:10:25 -08:00
parent 052d387ae5
commit 4ba7408363

View File

@ -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
}