Hi. I would like to suggest to add functionality to argparse
For example we can have one ArgumentParser instance, for (windows, linux),
(community edition, pro edition) apps. It could give ability to show and be
able to run only allowed commands based on version of os, app or some other
logic.
import argparse
def some_callable():
if edition() == 'pro_edition':
return True
return False
parser = argparse.ArgumentParser(
prog="CustomProgramm",
description="CustomProgramms custom description",
epilog='Epilog of this',
)
parser.add_argument('--full-function', target=some_callable)
This --full-function argument will be available only if some_callable function
is True, otherwise it will not be shown in command line arguments.
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/E2LMZQ2PAIBYMN3M64T4QBVYLWSHHG7K/
Code of Conduct: http://python.org/psf/codeofconduct/