From fc38da06c7dea32e49ead1a2f26c69efb326102c Mon Sep 17 00:00:00 2001 From: Nuno Duarte Date: Tue, 30 Oct 2018 00:28:09 +0000 Subject: [PATCH 1/2] Added long option for version output --- shallow_backup/cli.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shallow_backup/cli.py b/shallow_backup/cli.py index efd9d469..85aeacc3 100644 --- a/shallow_backup/cli.py +++ b/shallow_backup/cli.py @@ -31,9 +31,9 @@ @click.option('--remote', default=None, help="Set remote URL for the git repo.") @click.option('--rm', default=None, type=str, help="Remove path from backup.") @click.option('-show', is_flag=True, default=False, help="Display config file.") -@click.option('-v', is_flag=True, default=False, help='Display version and author information and exit.') +@click.option('--version', '-v', is_flag=True, default=False, help='Display version and author information and exit.') def cli(add, rm, show, all, dotfiles, configs, packages, fonts, old_path, new_path, remote, reinstall_all, - reinstall_configs, reinstall_dots, reinstall_fonts, reinstall_packages, delete_config, destroy_backup, v): + reinstall_configs, reinstall_dots, reinstall_fonts, reinstall_packages, delete_config, destroy_backup, version): """ \b Easily back up installed packages, dotfiles, and more. @@ -43,7 +43,7 @@ def cli(add, rm, show, all, dotfiles, configs, packages, fonts, old_path, new_pa """ # Process CLI args - admin_action = any([v, delete_config, destroy_backup, show, rm]) or None not in add + admin_action = any([version, delete_config, destroy_backup, show, rm]) or None not in add has_cli_arg = any([old_path, all, dotfiles, packages, fonts, configs, reinstall_dots, reinstall_fonts, reinstall_all, reinstall_configs, reinstall_packages]) @@ -52,7 +52,7 @@ def cli(add, rm, show, all, dotfiles, configs, packages, fonts, old_path, new_pa # Perform administrative action and exit. if admin_action: - if v: + if version: print_version_info() elif delete_config: # TODO: Error checking. From 9df8c2cf066ceec3d153d01e44f8e83b7020ac80 Mon Sep 17 00:00:00 2001 From: Nuno Duarte Date: Tue, 30 Oct 2018 19:27:04 +0000 Subject: [PATCH 2/2] Updated README to reflect new version option --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ef69299d..fd0b1df6 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ Options: --remote TEXT Set remote URL for the git repo. --rm TEXT Remove path from config. -show Show config file. - -v Display version and author information and exit. + -v, --version Display version and author information and exit. -h, -help, --help Show this message and exit. ```