Skip to content

Commit

Permalink
Updated parser for version and default action
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Hui committed Mar 20, 2023
1 parent 2cd1d7b commit 9a7971d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions e4e_data_management/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def __init__(self):
# self.__configure_zip_parser(parsers['zip'])
# self.__configure_unzip_parser(parsers['unzip'])

self.parser.add_argument('--version', action='store_true')
self.parser.add_argument('--version', action='version', version=f'e4edm {__version__}')
self.parser.set_defaults(func=self.parser.print_help)


def configure_parameters(self, parameter: str, value: Optional[str]) -> None:
Expand Down Expand Up @@ -182,11 +183,6 @@ def main(self):
args = self.parser.parse_args()
arg_dict = vars(args)

if arg_dict['version']:
print(f'e4edm version {__version__}')
return
arg_dict.pop('version')

arg_fn = args.func
arg_dict.pop('func')

Expand Down

0 comments on commit 9a7971d

Please sign in to comment.