From 391cf217966a672307af19e85e08948ac8ac7f1a Mon Sep 17 00:00:00 2001 From: Jon Bernard Date: Sat, 27 Aug 2011 10:12:28 -0400 Subject: Expose move operation on the CLI --- dotfiles/cli.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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') -- cgit v1.2.3