We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Content of manage.py
manage.py
""" Manage database objects Usage: manage [-h] COMMAND [options] """ import hug # Create user api users_api = hug.API(name='users', doc='Manage users') @hug.object(name='user', api=users_api) class UsersCLI: @staticmethod @hug.object.cli def add(name:hug.types.text): """Create user""" @staticmethod @hug.object.cli def rm(id:hug.types.number): """Remove user with given id""" # Create permission api permissions_api = hug.API(name='permissions', doc="Manage users permissions") @hug.object(name='permission', api=permissions_api) class PermissionCLI: @staticmethod @hug.object.cli def add(name:hug.types.text): """Create permission""" @staticmethod @hug.object.cli def attach(uid:hug.types.number, pid:hug.types.number): """Give permission {pid} to user {uid}""" def main(): api = hug.API(name='manage', doc=__doc__) api.extend(users_api, sub_command='users') api.extend(permissions_api, sub_command='permissions') api.cli() if __name__ == '__main__': main()
Currently doing...
python -m manage
...results in :
Manage database objects Usage: manage [-h] COMMAND [options] Available Commands: - users: Manage users Available Commands: - add: Create user - rm: Remove... - permissions: Manage users permissions Available Commands: - add: Create...
It should rather be:
Manage database objects Usage: manage [-h] COMMAND [options] Available Commands: - users Manage users - permissions Manage users permissions
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
CLI help message seems broken when using subcommands
Example for the following code
Content of
manage.py
Actual behavior
Currently doing...
...results in :
Proposed behavior
It should rather be:
The text was updated successfully, but these errors were encountered: