Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added long option for version output #170

Merged
merged 1 commit into from
Nov 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Options:
-reinstall_all Full reinstallation.
--remote TEXT Set remote URL for the git repo.
-show Display config file.
-v Display version and author information and
-v, --version Display version and author information and
exit.
-h, -help, --help Show this message and exit.
```
Expand Down
8 changes: 4 additions & 4 deletions shallow_backup/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
@click.option('-reinstall_all', is_flag=True, default=False, help="Full reinstallation.")
@click.option('--remote', default=None, help="Set remote URL for the git repo.")
@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(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.
Expand All @@ -40,7 +40,7 @@ def cli(show, all, dotfiles, configs, packages, fonts, old_path, new_path, remot
"""

# Process CLI args
admin_action = any([v, delete_config, destroy_backup, show])
admin_action = any([version, delete_config, destroy_backup, show])
has_cli_arg = any([old_path, all, dotfiles, packages, fonts, configs,
reinstall_dots, reinstall_fonts, reinstall_all,
reinstall_configs, reinstall_packages])
Expand All @@ -49,7 +49,7 @@ def cli(show, all, dotfiles, configs, packages, fonts, old_path, new_path, remot

# Perform administrative action and exit.
if admin_action:
if v:
if version:
print_version_info()
elif delete_config:
# TODO: Error checking.
Expand Down