plutopluto

git clone https://git.ce9e.org/plutopluto.git

commit
aad0ca8bc63fb70265ba3d00e60aa8a0cc97dfac
parent
fc9a37525cc6182e25d6adb69897bea837013f99
Author
Tobias Bengfort <tobias.bengfort@gmx.net>
Date
2014-09-25 19:48
improve command line interface

Diffstat

M server.py 8 +++++---

1 files changed, 5 insertions, 3 deletions


diff --git a/server.py b/server.py

@@ -97,10 +97,11 @@ def config():
   97    97 
   98    98 
   99    99 if __name__ == '__main__':
  100    -1 	parser = argparse.ArgumentParser()
   -1   100 	parser = argparse.ArgumentParser(description='simple feed aggregator')
  101   101 	parser.add_argument('-d', '--debug', action='store_true')
  102    -1 	parser.add_argument('-c', '--config')
  103    -1 	parser.add_argument('urls', metavar='url', nargs='*')
   -1   102 	parser.add_argument('-c', '--config', metavar='FILE')
   -1   103 	parser.add_argument('urls', metavar='URL', nargs='*',
   -1   104 		help='full feed url, optionally with a {page} placeholder')
  104   105 	args = parser.parse_args()
  105   106 
  106   107 	if args.config:
@@ -110,6 +111,7 @@ if __name__ == '__main__':
  110   111 
  111   112 	if not app.config['URLS']:
  112   113 		print("Error: No urls provided")
   -1   114 		parser.print_usage()
  113   115 		sys.exit(1)
  114   116 
  115   117 	app.run(app.config.get('HOST'), app.config.get('PORT'))