Skip to main content

specify command arguments in function decorator

Project description

argdeco
=======

Specify command line arguments using decorators::

from argdeco import main, arg, opt

@main(
arg("--foo", help="some argument"),
opt("--flag", '-f', help="toggle flag"),
)
def my_main_function(foo, flag):
return 0 # success, will be exit code

if __name__ == '__main__':
main()

argdeco is an argparse wrapper.

* ``arg()`` is only a wrapper around ``argparse.ArgumentParser.add_argument()``.
* ``opt()`` is a shorthand for ``arg(..., action=store_true, default=False)``

... you can do `much more`_

.. [much more] https://python-argdeco.readthedocs.io

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

argdeco-2.1.7.tar.gz (16.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page