summaryrefslogtreecommitdiffstats
path: root/fedora_business_cards
diff options
context:
space:
mode:
authorIan Weller <ianweller@gmail.com>2008-09-28 20:03:08 -0500
committerIan Weller <ianweller@gmail.com>2008-09-28 20:03:08 -0500
commite7d63b2ec7ab2a0fc65cd98b5cddec5457f1bd2e (patch)
treea4ef2393f74b2676219c1198a190e3a5a918b33c /fedora_business_cards
parent1b7e61a42581b6172dbc312fc692d6cd2d0a73f5 (diff)
downloadfedora-business-cards-e7d63b2ec7ab2a0fc65cd98b5cddec5457f1bd2e.tar.gz
fedora-business-cards-e7d63b2ec7ab2a0fc65cd98b5cddec5457f1bd2e.tar.xz
fedora-business-cards-e7d63b2ec7ab2a0fc65cd98b5cddec5457f1bd2e.zip
Add options to frontend
Diffstat (limited to 'fedora_business_cards')
-rw-r--r--fedora_business_cards/frontend.py22
1 files changed, 20 insertions, 2 deletions
diff --git a/fedora_business_cards/frontend.py b/fedora_business_cards/frontend.py
index 25fc99d..007657d 100644
--- a/fedora_business_cards/frontend.py
+++ b/fedora_business_cards/frontend.py
@@ -25,7 +25,25 @@ whatnot, but for now just has a command-line interface.
from optparse import OptionParser
def cmdline():
+ """
+ Command-line interface to business card generator. Takes no arguments; uses
+ optparser.OptionParser instead.
+ """
parser = OptionParser()
- parser.add_option("-d", "--dpi", dest="dpi", default=300,
- help="DPI of exported PNG")
+ parser.usage = "%prog [options] [outfile]"
+ parser.add_option("-d", "--dpi", dest="dpi", default=300, type="int",
+ help="DPI of exported file")
+ parser.add_option("-t", "--template", dest="template",
+ default="northamerica", help="Name of template to use, "+\
+ "run with --list-templates to see a list")
+ parser.add_option("--list-templates", dest="template", action="store_true",
+ dest="listtemplates", default=False,
+ help="List available templates")
+ parser.add_option("-u", "--username", dest="username", default="",
+ help="If set, use a different name than the one logged"+\
+ " in with to fill out business card information")
+ parser.add_option("--pdf", dest="output", default="png", const="pdf",
+ action="store_const", help="Export as PDF")
+ parser.add_option("--png", dest="output", default="png", const="png",
+ action="store_const", help="Export as PNG (default)")
options = parser.parse_args()[0]