aboutsummaryrefslogtreecommitdiffstats
path: root/dotfiles.py
diff options
context:
space:
mode:
authorGravatar Jon Bernard <jbernard@tuxion.com> 2016-01-04 05:37:06 -0500
committerGravatar Jon Bernard <jbernard@tuxion.com> 2016-01-04 05:39:19 -0500
commit496a50a9995ba85c107e220a01b2a218a7267c6c (patch)
tree962d13becda341c2a667d4da0aef6bd888f03314 /dotfiles.py
parentf216646d2e824af726a7cd0d4d881577ea6dd0d8 (diff)
downloaddotfiles-496a50a9995ba85c107e220a01b2a218a7267c6c.tar.gz
dotfiles-496a50a9995ba85c107e220a01b2a218a7267c6c.tar.bz2
dotfiles-496a50a9995ba85c107e220a01b2a218a7267c6c.zip
Use click decorator for version option
Diffstat (limited to 'dotfiles.py')
-rw-r--r--dotfiles.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/dotfiles.py b/dotfiles.py
index ce0d31a..9a7fe9a 100644
--- a/dotfiles.py
+++ b/dotfiles.py
@@ -5,8 +5,6 @@ import errno
from operator import attrgetter
-__version__ = '0.7-dev'
-
DEFAULT_HOME = os.path.expanduser('~/')
DEFAULT_REPO = os.path.expanduser('~/Dotfiles')
@@ -131,6 +129,7 @@ pass_repo = click.make_pass_decorator(Repository)
show_default=True)
@click.option('--repository', type=click.Path(), default=DEFAULT_REPO,
show_default=True)
+@click.version_option()
@click.pass_context
def cli(ctx, home_directory, repository):
"""Dotfiles is a tool to make managing your dotfile symlinks in $HOME easy,
@@ -220,9 +219,3 @@ def unsync(repo, files):
"""TODO"""
for filename in files:
repo.unsync(filename)
-
-
-@cli.command()
-def version():
- """Show the version number."""
- click.echo("dotfiles version %s" % __version__)