openva / crump

A parser for the Virginia State Corporation Commission's business registration records.
https://vabusinesses.org/
MIT License
20 stars 3 forks source link

How to negate a default-true flag? #49

Closed waldoj closed 10 years ago

waldoj commented 10 years ago

We're using argparse.add_argument to deal with command-line switches, with a few that default to true. But how does one set those to false? I assume that this is handled natively by argparse is one way, but I don't know what it is.

waldoj commented 10 years ago

Ignoring Python's framework, and just thinking of every Unix program I've used in the past 20-odd years, I'm pretty sure that we'll need to add new flags to disable switches. So, for instance, if we want to make -t (transform) a flag enabled by default, then we just need (say) a -d flag to indicate "don't transform."