Skip to content

Commit

Permalink
add standard --version and --help args
Browse files Browse the repository at this point in the history
  • Loading branch information
crccheck committed May 27, 2014
1 parent 8895acd commit ab879b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion postdoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
from urlparse import urlparse


__version__ = '0.1.3'

# http://www.postgresql.org/docs/9.3/static/reference-client.html
VALID_COMMANDS = (
'clusterdb',
Expand Down Expand Up @@ -69,7 +71,9 @@ def pg_command(command, meta):


def main():
if len(sys.argv) < 2:
if '--version' in sys.argv:
exit('PostDoc {0}'.format(__version__))
if '--help' in sys.argv or len(sys.argv) < 2:
exit('Usage: phd COMMAND [additional-options]\n\n'
' ERROR: Must give a COMMAND like psql, createdb, dropdb')
if sys.argv[1] not in VALID_COMMANDS:
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

setup(
name='postdoc',
# hey, remember to update postdoc.__version__ too
version='0.1.3',
description='A helper for Postgres + Docker that works for free',
long_description=open('README.rst').read(),
Expand Down

0 comments on commit ab879b6

Please sign in to comment.