Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Use proper argparse subparsers #29

mbr opened this Issue · 3 comments

3 participants


Currently, Flask-script always uses sys.argv[1] as the command arguments. This is somewhat annoying, especially if you add a global option -c, --config to specify a script on the command line. Consider this:

./ -c dev.conf create_user foo

Looks quite natural, all options before create_user apply to the app itself, all after create_user to the command. Argparse supports this through subparsers.

Unfortunately, the current implementation requires this:

./ create_user -c dev.conf foo


./ create_user foo -c dev.conf

These two are incredibly annoying - there's no way to alias or reuse a commandline, because in both cases you have to edit it somewhere in the middle to change the command. Using the better way described up top, Flask-Script will complain that it doesn't know the command -c. This is mainly because the extension is not properly using argparse, but rather creating multiple parsers on the fly and using a custom crutch to handle commands.


I'll look into this, but with the recent release of the sub-manager feature, it might make this more difficult to support as determining which Manager / sub-Manager to use is hierarchical by argument position.


8fdc0c6 closes #29

Proposed version bump to 0.6.0 or 1.0.0.


I've setup the next version to be 1.0.0. Still need to overhaul the docs and clean up a few thing, but should be out in the next week or so.

@techniq techniq closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.