Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

"error: too many arguments" with nargs='+' #142

Closed
touilleMan opened this issue Aug 6, 2015 · 1 comment
Closed

"error: too many arguments" with nargs='+' #142

touilleMan opened this issue Aug 6, 2015 · 1 comment

Comments

@touilleMan
Copy link
Contributor

Hi there,

Here is an example of a not-so-expected behavior:

# manage.py

from flask import Flask
from flask.ext.script import Manager

app = Flask(__name__)
m = Manager(app)


@m.command
@m.option('--args', nargs='+')
def test(args=None):
    print(args)

m.run()
$ python test.py test --args e e
usage: test.py [-?] {shell,runserver,test} ...
test.py: error: too many arguments
$ python test.py test --args e  
e
$ python test.py test --args  
usage: test.py test [-?] [-a ARGS]
test.py test: error: argument -a/--args: expected one argument

It seems the nargs argument is totally ignored by flask-script, any idea what's wrong ?

@touilleMan
Copy link
Contributor Author

My bad, see #143

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant