Skip to content

Commit 688014b

Browse files
committed
add version option
1 parent 9784717 commit 688014b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

vcspull/cli.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,13 @@ def get_command(self, ctx, cmd_name):
6868
@click.option('--log_level', default='INFO',
6969
help='Log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)')
7070
@click.option('--version', is_flag=True, help='Print version info')
71+
@click.version_option(version=__version__, message='%(prog)s %(version)s')
72+
@click.pass_context
7173
def cli(log_level, version):
7274
setup_logger(
7375
level=log_level.upper()
7476
)
7577

76-
if version:
77-
print('vcspull %s' % __version__)
78-
return
79-
8078

8179
@click.command(name='update')
8280
@click.argument('repos', nargs=-1)

0 commit comments

Comments
 (0)