diff options
author | Jon Bernard <jbernard@tuxion.com> | 2011-08-27 10:12:28 -0400 |
---|---|---|
committer | Jon Bernard <jbernard@tuxion.com> | 2011-08-27 10:12:28 -0400 |
commit | 391cf217966a672307af19e85e08948ac8ac7f1a (patch) | |
tree | f30853a032ad31dae8b6b4ba6743e251944dc554 | |
parent | bf6ad3b0b4e7065d1ff1f3f5cdec61cba386813b (diff) | |
download | dotfiles-391cf217966a672307af19e85e08948ac8ac7f1a.tar.gz dotfiles-391cf217966a672307af19e85e08948ac8ac7f1a.tar.bz2 dotfiles-391cf217966a672307af19e85e08948ac8ac7f1a.zip |
Expose move operation on the CLI
-rw-r--r-- | dotfiles/cli.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/dotfiles/cli.py b/dotfiles/cli.py index e9cf19a..2e5458c 100644 --- a/dotfiles/cli.py +++ b/dotfiles/cli.py @@ -65,6 +65,10 @@ def parse_args(): action_group.add_option("-s", "--sync", action="store_const", dest="action", const="sync", help="update dotfile symlinks") + action_group.add_option("-m", "--move", action="store_const", + dest="action", const="move", help="move dotfiles repository to " \ + "another location") + parser.add_option_group(action_group) (opts, args) = parser.parse_args() @@ -97,6 +101,10 @@ def main(): if not opts.repo and parser.get('dotfiles', 'repository'): opts.repo = os.path.expanduser(parser.get('dotfiles', 'repository')) + if opts.action == 'move': + # TODO: update the configuration file after the move + print 'Remember to update the repository location ' \ + 'in your configuration file (%s).' % (opts.config) if not opts.prefix and parser.get('dotfiles', 'prefix'): opts.prefix = parser.get('dotfiles', 'prefix') |