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

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

Closed

Description

@touilleMan

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 ?

Activity

  1. touilleMan commented on Aug 15, 2015

    @touilleMan
    ContributorAuthor

    My bad, see #143

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions