Skip to content

Commit

Permalink
ENH #333 add version option
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Jul 11, 2020
1 parent 1796479 commit ffe7c67
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion apstools/beamtime/apsbss.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
~main
"""

import argparse
import datetime
import dm # APS data management library
import os
Expand Down Expand Up @@ -471,11 +470,21 @@ def trim(text, length=40):

def get_options():
"""Handle command line arguments."""
import argparse
from apstools._version import get_versions
version = get_versions()['version']

parser = argparse.ArgumentParser(
prog=os.path.split(sys.argv[0])[-1],
description=__doc__.strip().splitlines()[0],
)

parser.add_argument('-v',
'--version',
action='version',
help='print version number and exit',
version=version)

subcommand = parser.add_subparsers(dest='subcommand', title='subcommand')

subcommand.add_parser('beamlines', help="print list of beamlines")
Expand Down

0 comments on commit ffe7c67

Please sign in to comment.