aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Jon Bernard <jbernard@tuxion.com> 2016-01-08 07:45:26 -0500
committerGravatar Jon Bernard <jbernard@tuxion.com> 2016-01-08 07:51:30 -0500
commit75d4fb6bc14a4dcf8b503d5d8477b2eb7af83750 (patch)
tree01cdfdadb390b76a78532b255187093f49032d43
parent190ee4e82363b3464b0f162681262dccc865dfe6 (diff)
downloaddotfiles-75d4fb6bc14a4dcf8b503d5d8477b2eb7af83750.tar.gz
dotfiles-75d4fb6bc14a4dcf8b503d5d8477b2eb7af83750.tar.bz2
dotfiles-75d4fb6bc14a4dcf8b503d5d8477b2eb7af83750.zip
Remove home directory cli option
-rw-r--r--dotfiles.py10
-rw-r--r--test_dotfiles.py9
2 files changed, 9 insertions, 10 deletions
diff --git a/dotfiles.py b/dotfiles.py
index e5a81e8..b9f06cc 100644
--- a/dotfiles.py
+++ b/dotfiles.py
@@ -165,18 +165,16 @@ pass_repo = click.make_pass_decorator(Repository)
@click.group(context_settings=dict(help_option_names=['-h', '--help']))
-@click.option('--home-directory', type=click.Path(), default=DEFAULT_HOME,
- show_default=True)
-@click.option('--repository', type=click.Path(), default=DEFAULT_REPO,
- show_default=True)
+@click.option('--repository', type=click.Path(), show_default=True,
+ default=DEFAULT_REPO_PATH)
@click.version_option()
@click.pass_context
-def cli(ctx, home_directory, repository):
+def cli(ctx, repository):
"""Dotfiles is a tool to make managing your dotfile symlinks in $HOME easy,
allowing you to keep all your dotfiles in a single directory.
"""
ctx.obj = Repository(py.path.local(repository),
- py.path.local(home_directory))
+ py.path.local(DEFAULT_HOMEDIR),
DEFAULT_REPO_IGNORE)
diff --git a/test_dotfiles.py b/test_dotfiles.py
index adefdb2..79274f3 100644
--- a/test_dotfiles.py
+++ b/test_dotfiles.py
@@ -13,10 +13,11 @@ class TestCli(object):
def test_remove(self):
assert False
- def test_status(self, runner, repo, home):
- result = runner.invoke(cli, ['--home-directory', str(home),
- '--repository', str(repo),
- 'status'])
+ def test_status(self, runner, repo, home, monkeypatch):
+ monkeypatch.setattr('dotfiles.DEFAULT_HOMEDIR', str(home))
+ monkeypatch.setattr('dotfiles.DEFAULT_REPO_PATH', str(repo))
+
+ result = runner.invoke(cli, ['status'])
assert not result.exception
assert result.output == ''