Skip to content
New issue

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

Display extended-instructions for specific commands #123

Open
Kentoseth opened this issue Sep 21, 2017 · 0 comments
Open

Display extended-instructions for specific commands #123

Kentoseth opened this issue Sep 21, 2017 · 0 comments
Labels
Milestone

Comments

@Kentoseth
Copy link

Say I have the following:

import argh

def foo():
    "This is my function"
    print("Hello world!")

If I run this app with python bar.py -h the output I will get will be:

usage: bar.py [-h] {foo} ...

positional arguments:
  {foo}
    foo             This is my function

How do I provide added instructions so that when I run python bar.py foo -h, I can get output like so:

usage: bar.py foo [-h]

    This is my function
    1) this is my added instruction specifically when calling this command
    2) this is my 2nd added instruction when calling this command
    3) These commands will only be shown when running {command} -h

When I add the instructions like so:

def foo():
    '''
    This is my function
    1) this is my added instruction specifically when calling this command
    2) this is my 2nd added instruction when calling this command
    3) These commands will only be shown when running {command} -h
    '''
    print("Hello world!")

It outputs the entire instructions when running python bar.py -h .

@neithere neithere added this to the 1.1 milestone Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants