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

Extended API usage #10

Open
hexylena opened this issue Jan 20, 2015 · 2 comments
Open

Extended API usage #10

hexylena opened this issue Jan 20, 2015 · 2 comments

Comments

@hexylena
Copy link
Owner

Conditionals

Need some way to support conditionals.

parser = argparse.ArgumentParser()
parser.add_argument('bar', choices=('a', 'b', 'c'))

def bar_test(value):
    return value == 'a'

parser.add_argument('baz', depends_on='bar', when=bar_test)

????

Please comment/edit issue for input.

@TorHou
Copy link

TorHou commented Jul 27, 2015

subparser

Two people in our group immediately after using argparse started using subparser. This would be really nice to have, yet I guess it might be tricky to implement.

As far as I understand they use subparser for mode setting. Different modes enable different parameters and different usage texts are displayed depending on the mode. So this comes back to conditionals in Galaxy I guess.

@hexylena
Copy link
Owner Author

Makes sense @TorHou :) It shouldn't be too tough to wrap the whole thing in a giant conditional for all subparser blocks

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

No branches or pull requests

3 participants