diff options
author | Jon Bernard <jbernard@tuxion.com> | 2011-06-29 14:02:08 -0400 |
---|---|---|
committer | Jon Bernard <jbernard@tuxion.com> | 2011-06-29 14:02:08 -0400 |
commit | cd9eb8fafc237ba8bd64549a2cecba7db613611b (patch) | |
tree | 19d58ba05073188e2ea9559ba46c930c2ea43fee | |
parent | 24c2c90a2f166febcce9e79981cec0eb18fcf922 (diff) | |
download | dotfiles-cd9eb8fafc237ba8bd64549a2cecba7db613611b.tar.gz dotfiles-cd9eb8fafc237ba8bd64549a2cecba7db613611b.tar.bz2 dotfiles-cd9eb8fafc237ba8bd64549a2cecba7db613611b.zip |
Show a helpful message to first-time users
-rw-r--r-- | dotfiles/cli.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/dotfiles/cli.py b/dotfiles/cli.py index 95e3b82..fda0a2e 100644 --- a/dotfiles/cli.py +++ b/dotfiles/cli.py @@ -5,6 +5,27 @@ from . import core import ConfigParser from optparse import OptionParser, OptionGroup +USAGE = "Usage: %prog ACTION [OPTION...] [FILE...]" + +NO_REPO_MESSAGE = """Could not find dotfiles repository \"%s\" + +If this is your first time running dotfiles, you must first create a +repository. By default, dotfiles will look for '~/Dotfiles'. Something like: + + $ mkdir ~/Dotfiles + +is all you need to do. If you don't like the default, you can put your +repository wherever you like. You have two choices once you've created your +repository. You can specify the path to the repository on the command line +using the '-R' flag. Alternatively, you can create a configuration file at +'~/.dotfilesrc' and place the path to your repository in there. The contents +would look like: + + [dotfiles] + repository = ~/.my-dotfiles-repo + +You can see more information by typing 'dotfiles -h'""" + def method_list(object): return [method for method in dir(object) @@ -12,7 +33,7 @@ def method_list(object): def parse_args(): - parser = OptionParser(usage="Usage: %prog ACTION [OPTION...] [FILE...]") + parser = OptionParser(usage=USAGE) parser.set_defaults(config=os.path.expanduser("~/.dotfilesrc")) parser.set_defaults(ignore=[]) |