Switched view back to previous argument format (viewer is an optional argument without a flag)
--- a/alexandria.py Wed Sep 02 16:44:54 2009 -0700
+++ b/alexandria.py Wed Sep 02 16:49:05 2009 -0700
@@ -100,9 +100,9 @@
session.commit()
_show_paper(p)
-@command([('v', 'viewer', '', 'viewer to use')] + dbopts,
- usage = '%name [-v VIEWER] HASH')
-def view(cfg, hash, **opts):
+@command(dbopts,
+ usage = '%name HASH [VIEWER]')
+def view(cfg, hash, viewer = None, **opts):
"""View paper by hash"""
p = Paper.query.filter(Paper.md5.startswith(hash)).all()
@@ -118,7 +118,7 @@
else:
p = p[0]
- viewer = opts['viewer'] or cfg['default_viewer']
+ viewer = viewer or cfg['default_viewer']
os.system('%s %s' % (viewer, os.path.join(cfg['commonpath'], p.path.strip('/'))))
@command(dbopts,