argparse icon indicating copy to clipboard operation
argparse copied to clipboard

best practice for exporting all args

Open vsoch opened this issue 9 years ago • 1 comments

Is there a best practice / suggestion for exporting all arguments from a script that uses argparse? For example, I'm developing an application that needs to understand what inputs / types are allowed and required, and starting with a standard argument parser seems like the right way to go. Some possible ideas I've been thinking of are something that would use inspect, or having a standard template that returns the parse object. Ideally, any script using argparse should be able to be run through this function to produce some data structure that contains this information (with minimal requirements to customize the script with argparse)!

vsoch avatar Jul 11 '16 22:07 vsoch

right now my best workaround is to provide a template script with argparse that has a function to return the parser

vsoch avatar Jul 12 '16 00:07 vsoch