Skip to content

Commit

Permalink
Add version option
Browse files Browse the repository at this point in the history
  • Loading branch information
johnandrea authored Dec 14, 2023
1 parent be29848 commit 47323d8
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions gedcom-display-format.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
UNION_LABEL = '@'


def show_version():
print( '2.4.3' )
def get_version():
return '2.5'


def load_my_module( module_name, relative_path ):
Expand Down Expand Up @@ -61,7 +61,6 @@ def load_my_module( module_name, relative_path ):
def get_program_options():
results = dict()

results['version'] = False
results['format'] = 'graphml'
results['infile'] = None
results['include'] = 'all'
Expand All @@ -76,7 +75,7 @@ def get_program_options():
parser = argparse.ArgumentParser( description=arg_help )

arg_help = 'Show version then exit.'
parser.add_argument( '--version', default=results['version'], action='store_true', help=arg_help )
parser.add_argument( '--version', action='version', version=get_version() )

formats = [results['format'], 'dot', 'json', 'newick']
arg_help = 'Output format. One of: ' + str(formats) + ', Default: ' + results['format']
Expand Down Expand Up @@ -117,7 +116,6 @@ def get_program_options():

args = parser.parse_args()

results['version'] = args.version
results['format'] = args.format.lower()
results['include'] = args.include.lower()
results['personid'] = args.personid
Expand Down Expand Up @@ -728,10 +726,6 @@ def options_ok( program_options ):

options = get_program_options()

if options['version']:
show_version()
sys.exit( 0 )

readgedcom = load_my_module( 'readgedcom', options['libpath'] )

ikey = readgedcom.PARSED_INDI
Expand Down

0 comments on commit 47323d8

Please sign in to comment.