This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
# dont-argue
Dead-simple command line arguments for python scripts.

I got sick of re-learning the argparse module every time I just needed to pass
in a few simple command line arguments for a python script. `dont_argue` skips
the boring stuff and lets you get started in a flash.

## Usage

**dont\_argue** provides the decorator **supply\_args**, use it on a function
and that function's arguments will be provided from the command line.

Check it out:
```python
#!/usr/bin/python
from dont_argue import supply_args
@supply_args
def main(name, location, *friends):
friends = ', '.join(friends)
print 'Hello {} from {} and your friends {}'.format(name, location, friends)

# Now to kick things off we just call the function, the arguments come from the
# command line, so we don't give any here.
main()
```

Try it out:
```
$ ./example.py Joe Alabama Jake Drake
Hello Joe from Alabama and your friends Jake, Drake
```
If that's all you need, then you're done! Also notice how all the extra
arguments get packed up into `*friends` as expected.

You can also work with command line options by specifying keyword arguments for
your function. They can be specified on the command line using the
`--option=value` or `--option value` syntax.
```python
@supply_args
def main(name, mood='FRIENDLY'):
if mood == 'FRIENDLY':
print 'Hello {}! Welcome here!'.format(name)
elif mood == 'ANGRY':
print 'Hey {}! Get out of my house!'.format(name)
main()
```

Now we can specify `mood` or not. Also note that providing too few arguments or
using the -h flag will display usage information.
```
$ ./test.py Joe
Hello Joe! Welcome here!
$ ./example.py Joe --mood ANGRY
Hey Joe! Get out of my house!
$ ./example.py -h
usage: example.py [-h] [--mood MOOD] name

positional arguments:
name

optional arguments:
-h, --help show this help message and exit
--mood MOOD
```

Arbitrary keyword arguments don't make a ton of sense on the command line, so
you must explicitly declare your keyword arguments, `**kwargs` won't work with
command line options.
Release History

Release History

0.1.3

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
dont_argue-0.1.3.tar.gz (3.1 kB) Copy SHA256 Checksum SHA256 Source Feb 16, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting