"error: too many arguments" with nargs='+'
touilleMan opened this issue · 1 comments
touilleMan commented
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 commented
My bad, see #143