Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added '--version' option #111

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ Then, to run the program, type
$ climesync
```

To view help, type

```
$ climesync -h
```

To view the program version and license information, type

```
$ climesync -v
```

climesync accepts args like so:

```
Expand Down
9 changes: 9 additions & 0 deletions climesync/climesync.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

Options:
-h --help Print this dialog
-v --version Print version and license information
and exit
-c <baseurl> --connect=<baseurl> TimeSync Server URL
-u <username> --username=<username> Username of user to authenticate as
-p <password> --password=<password> Password of user to authenticate as
Expand Down Expand Up @@ -163,6 +165,13 @@ def scripting_mode(command_name, argv):
def main(argv=None, test=False):
# Command line arguments
args = docopt(__doc__, argv=argv, options_first=True)

if args['-v']:
print "Climesync 0.1.1"
with open("LICENSE", "r") as f:
print f.read()
return

url = args['-c']
user = args['-u']
password = args['-p']
Expand Down