You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 10, 2020. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 10, 2020. It is now read-only.
I had this problem as well. Since argparse is used behind the scenes, I expected Option(..., nargs=argparse.REMAINDER) to do the trick. It looks fine in python manage.py mycommand -? but I still get the manage.py: error: too many arguments as well. Good to know the capture_all_args attribute works as well, but it's still a bit annoying.
By the way, it seems to work as:
class HelloCommand(Command):
capture_all_args = True
def run(self, allargs):
print 'Hello, the argument list was: ' + repr(allargs)
Activity
jlumpe commentedon Jan 22, 2016
I had this problem as well. Since
argparseis used behind the scenes, I expectedOption(..., nargs=argparse.REMAINDER)to do the trick. It looks fine inpython manage.py mycommand -?but I still get themanage.py: error: too many argumentsas well. Good to know thecapture_all_argsattribute works as well, but it's still a bit annoying.By the way, it seems to work as: