]> arthur.barton.de Git - bup.git/commitdiff
Streamline output: Usage error messages
authorAlexander Barton <alex@barton.de>
Wed, 31 Dec 2014 17:38:00 +0000 (18:38 +0100)
committerAlexander Barton <alex@barton.de>
Wed, 31 Dec 2014 17:50:18 +0000 (18:50 +0100)
All messages should start with a capital letter and contain complete
and correct punctuation.

Signed-off-by: Alexander Barton <alex@barton.de>
28 files changed:
cmd/bloom-cmd.py
cmd/cat-file-cmd.py
cmd/damage-cmd.py
cmd/drecurse-cmd.py
cmd/fuse-cmd.py
cmd/help-cmd.py
cmd/index-cmd.py
cmd/init-cmd.py
cmd/list-idx-cmd.py
cmd/margin-cmd.py
cmd/memtest-cmd.py
cmd/meta-cmd.py
cmd/midx-cmd.py
cmd/mux-cmd.py
cmd/newliner-cmd.py
cmd/on--server-cmd.py
cmd/on-cmd.py
cmd/random-cmd.py
cmd/restore-cmd.py
cmd/save-cmd.py
cmd/server-cmd.py
cmd/split-cmd.py
cmd/tag-cmd.py
cmd/tick-cmd.py
cmd/version-cmd.py
cmd/web-cmd.py
cmd/xstat-cmd.py
t/test-save-strip-graft.sh

index a79c7710c13b1fa9148efc13ef5c6d0fc631427b..4ca9ef11b4e93b73ad828fa8ed54a28800987357 100755 (executable)
@@ -139,12 +139,12 @@ o = options.Options(optspec)
 (opt, flags, extra) = o.parse(sys.argv[1:])
 
 if extra:
-    o.fatal('no positional parameters expected')
+    o.fatal('No positional parameters expected')
 
 git.check_repo_or_die()
 
 if not opt.check and opt.k and opt.k not in (4,5):
-    o.fatal('only k values of 4 and 5 are supported')
+    o.fatal('Only k values of 4 and 5 are supported')
 
 paths = opt.dir and [opt.dir] or git.all_packdirs()
 for path in paths:
index a2fec12fd4388970256441b57629b97ee1238a40..684c926ca695a63091c1cc06c055ff40fba7acd7 100755 (executable)
@@ -19,16 +19,16 @@ git.check_repo_or_die()
 top = vfs.RefList(None)
 
 if not extra:
-    o.fatal('must specify a target')
+    o.fatal('Must specify a target')
 if len(extra) > 1:
-    o.fatal('only one target file allowed')
+    o.fatal('Only one target file allowed')
 if opt.bupm and opt.meta:
-    o.fatal('--meta and --bupm are incompatible')
-    
+    o.fatal('Options "--meta" and "--bupm" are incompatible')
+
 target = extra[0]
 
 if not re.match(r'/*[^/]+/[^/]+', target):
-    o.fatal("path %r doesn't include a branch and revision" % target)
+    o.fatal("Path %r doesn't include a branch and revision" % target)
 
 try:
     n = top.lresolve(target)
@@ -43,7 +43,7 @@ if isinstance(n, vfs.FakeSymlink):
 
 if opt.bupm:
     if not stat.S_ISDIR(n.mode):
-        o.fatal('%r is not a directory' % target)
+        o.fatal('"%r" is not a directory' % target)
     mfile = n.metadata_file() # VFS file -- cannot close().
     if mfile:
         meta_stream = mfile.open()
index 4e951bf9e12d3467fb92a9a76777d0ce537c0e89..770f11b7c9021251e660c09b05d8cd9556f96df7 100755 (executable)
@@ -25,7 +25,7 @@ o = options.Options(optspec)
 (opt, flags, extra) = o.parse(sys.argv[1:])
 
 if not extra:
-    o.fatal('filenames expected')
+    o.fatal('Filenames expected')
 
 if opt.seed != None:
     random.seed(opt.seed)
index 9588835c97cf7c37f513362a0f8f2b71237b6dd2..f3a1a9836f8fa586e211531616f52391c2496461 100755 (executable)
@@ -19,7 +19,7 @@ o = options.Options(optspec)
 (opt, flags, extra) = o.parse(sys.argv[1:])
 
 if len(extra) != 1:
-    o.fatal("exactly one filename expected")
+    o.fatal("Exactly one filename expected")
 
 drecurse_top = extra[0]
 excluded_paths = parse_excludes(flags, o.fatal)
index 8e103b5ecf4604ca8c0e6795742960c3bf37c1bd..491f2a14caf0ccc14f4b5d603035201e19859377 100755 (executable)
@@ -127,7 +127,7 @@ o = options.Options(optspec)
 (opt, flags, extra) = o.parse(sys.argv[1:])
 
 if len(extra) != 1:
-    o.fatal("exactly one argument expected")
+    o.fatal("Exactly one argument expected")
 
 git.check_repo_or_die()
 top = vfs.RefList(None)
index 56a4148c745d1d2183c80107a07d8b9132146fe2..cd29933315526b72f89e0b05abeb8ff8115b91c0 100755 (executable)
@@ -25,4 +25,4 @@ elif len(extra) == 1:
         sys.stderr.write('Unable to run man command: %s\n' % e)
         sys.exit(1)
 else:
-    o.fatal("exactly one command name expected")
+    o.fatal("Exactly one command name expected")
index 3bbb5be03c83a76a13d7d8adbbf3ae104875b386..683f78c56c3f81f8f8feda3022f6c07ac82f2090 100755 (executable)
@@ -225,7 +225,7 @@ if (opt.fake_valid or opt.fake_invalid) and not opt.update:
 if opt.fake_valid and opt.fake_invalid:
     o.fatal('--fake-valid is incompatible with --fake-invalid')
 if opt.clear and opt.indexfile:
-    o.fatal('cannot clear an external index (via -f)')
+    o.fatal('Cannot clear an external index (via -f)')
 
 # FIXME: remove this once we account for timestamp races, i.e. index;
 # touch new-file; index.  It's possible for this to happen quickly
@@ -253,7 +253,7 @@ paths = index.reduce_paths(extra)
 
 if opt.update:
     if not extra:
-        o.fatal('update mode (-u) requested but no paths given')
+        o.fatal('Update mode (-u) requested but no paths given')
     for (rp,path) in paths:
         update_index(rp, excluded_paths, exclude_rxs)
 
index 49005d7c53bdaf0a144c77b76614e8e757ab7681..7c3a9a6d535d10e570e1cd057686d9b598dd966d 100755 (executable)
@@ -14,7 +14,7 @@ o = options.Options(optspec)
 (opt, flags, extra) = o.parse(sys.argv[1:])
 
 if extra:
-    o.fatal("no arguments expected")
+    o.fatal("No arguments expected")
 
 
 try:
index 43f6b06959b5a507d372fe821d94d95fd3036df5..83e3ecf5f52d8b741001bd8a1c26e921591afb63 100755 (executable)
@@ -15,7 +15,7 @@ handle_ctrl_c()
 opt.find = opt.find or ''
 
 if not extra:
-    o.fatal('you must provide at least one filename')
+    o.fatal('You must provide at least one filename')
 
 if len(opt.find) > 40:
     o.fatal('--find parameter must be <= 40 chars long')
index e2dcb43761bffab87a4b716353bcb0c4e99a513a..a7e51a37ca1aa5a88c6ccdda9609d1607dabc234 100755 (executable)
@@ -15,7 +15,7 @@ o = options.Options(optspec)
 (opt, flags, extra) = o.parse(sys.argv[1:])
 
 if extra:
-    o.fatal("no arguments expected")
+    o.fatal("No arguments expected")
 
 git.check_repo_or_die()
 git.ignore_midx = opt.ignore_midx
index 725e764dcac04788592919e791da60ba04bcd2e3..318a388414f4d5e6d1a74d1839c3ea8d32e25938 100755 (executable)
@@ -70,7 +70,7 @@ o = options.Options(optspec)
 (opt, flags, extra) = o.parse(sys.argv[1:])
 
 if extra:
-    o.fatal('no arguments expected')
+    o.fatal('No arguments expected')
 
 git.ignore_midx = opt.ignore_midx
 
index 932de383c0722473aba4c7c3f4a543b3cb1e1b6c..7dd3e001ef063f18158f2206747cc4db4a543405 100755 (executable)
@@ -69,13 +69,13 @@ action_count = sum([bool(x) for x in [opt.create, opt.list, opt.extract,
                                       opt.start_extract, opt.finish_extract,
                                       opt.edit]])
 if action_count > 1:
-    o.fatal("bup: only one action permitted: --create --list --extract --edit")
+    o.fatal("Only one action permitted: --create --list --extract --edit")
 if action_count == 0:
-    o.fatal("bup: no action specified")
+    o.fatal("No action specified")
 
 if opt.create:
     if len(remainder) < 1:
-        o.fatal("no paths specified for create")
+        o.fatal("No paths specified for create")
     output_file = open_output(opt.file)
     metadata.save_tree(output_file,
                        remainder,
@@ -85,29 +85,29 @@ if opt.create:
                        xdev=opt.xdev)
 elif opt.list:
     if len(remainder) > 0:
-        o.fatal("cannot specify paths for --list")
+        o.fatal("Cannot specify paths for --list")
     src = open_input(opt.file)
     metadata.display_archive(src)
 elif opt.start_extract:
     if len(remainder) > 0:
-        o.fatal("cannot specify paths for --start-extract")
+        o.fatal("Cannot specify paths for --start-extract")
     src = open_input(opt.file)
     metadata.start_extract(src, create_symlinks=opt.symlinks)
 elif opt.finish_extract:
     if len(remainder) > 0:
-        o.fatal("cannot specify paths for --finish-extract")
+        o.fatal("Cannot specify paths for --finish-extract")
     src = open_input(opt.file)
     metadata.finish_extract(src, restore_numeric_ids=opt.numeric_ids)
 elif opt.extract:
     if len(remainder) > 0:
-        o.fatal("cannot specify paths for --extract")
+        o.fatal("Cannot specify paths for --extract")
     src = open_input(opt.file)
     metadata.extract(src,
                      restore_numeric_ids=opt.numeric_ids,
                      create_symlinks=opt.symlinks)
 elif opt.edit:
     if len(remainder) < 1:
-        o.fatal("no paths specified for edit")
+        o.fatal("No paths specified for edit")
     output_file = open_output(opt.file)
 
     unset_user = False # True if --unset-user was the last relevant option.
index 56a3249706cd424ad1779a50a733c2e625c464a1..8e0234521f4ab5586c5dea1b4d8a4706cbf572e0 100755 (executable)
@@ -234,9 +234,9 @@ o = options.Options(optspec)
 (opt, flags, extra) = o.parse(sys.argv[1:])
 
 if extra and (opt.auto or opt.force):
-    o.fatal("you can't use -f/-a and also provide filenames")
+    o.fatal("You can't use -f/-a and also provide filenames")
 if opt.check and (not extra and not opt.auto):
-    o.fatal("if using --check, you must provide filenames or -a")
+    o.fatal("If using --check, you must provide filenames or -a")
 
 git.check_repo_or_die()
 
@@ -267,7 +267,7 @@ else:
             debug1('Multi-index: scanning %s ...' % path)
             do_midx_dir(path)
     else:
-        o.fatal("you must use -f or -a or provide input filenames")
+        o.fatal("You must use -f or -a or provide input filenames")
 
 if not check_saved_errors():
     sys.exit(1)
index 00e41ea25d759df16d6e357019b82bfcb9e681fd..630685cee09cb10e5098903dc09ebeda5c2f9d5f 100755 (executable)
@@ -10,7 +10,7 @@ bup mux command [arguments...]
 o = options.Options(optspec)
 (opt, flags, extra) = o.parse(sys.argv[1:])
 if len(extra) < 1:
-    o.fatal('command is required')
+    o.fatal('Command is required')
 
 subcmd = extra
 
index 68d327b7ee6aaac273f522fcc23bd2c4d36c2ba6..b6fad97d67a17db9cdf1deb44f4446ab8b88f599 100755 (executable)
@@ -10,7 +10,7 @@ o = options.Options(optspec)
 (opt, flags, extra) = o.parse(sys.argv[1:])
 
 if extra:
-    o.fatal("no arguments expected")
+    o.fatal("No arguments expected")
 
 r = re.compile(r'([\r\n])')
 lastlen = 0
index 327c81ffd8edc32cc945f7959de6b4cf45a04039..0f8b40ae45c69e97828de2e05f280a594603c1ee 100755 (executable)
@@ -10,7 +10,7 @@ bup on--server
 o = options.Options(optspec)
 (opt, flags, extra) = o.parse(sys.argv[1:])
 if extra:
-    o.fatal('no arguments expected')
+    o.fatal('No arguments expected')
 
 # get the subcommand's argv.
 # Normally we could just pass this on the command line, but since we'll often
index 90ee750fd26142a017b667a627ade840b074d478..c4db6f82f115d1c302538f8ef22745ba255e67a3 100755 (executable)
@@ -11,7 +11,7 @@ bup on <hostname> split ...
 o = options.Options(optspec, optfunc=getopt.getopt)
 (opt, flags, extra) = o.parse(sys.argv[1:])
 if len(extra) < 2:
-    o.fatal('arguments expected')
+    o.fatal('Arguments expected')
 
 class SigException(Exception):
     def __init__(self, signum):
index 445d7dd45dd2aba946da1962c9144ba9c98c6bf5..6c15fc858a4cabe3b1b098b4ab47fd1b0c2f6f77 100755 (executable)
@@ -14,7 +14,7 @@ o = options.Options(optspec)
 (opt, flags, extra) = o.parse(sys.argv[1:])
 
 if len(extra) != 1:
-    o.fatal("exactly one argument expected")
+    o.fatal("Exactly one argument expected")
 
 total = parse_num(extra[0])
 
index 3b888157e6590f4c0c9f5d70889e2ac1ec8f48b9..f025a71038521e1c1e577def2b0e1a2727f9275a 100755 (executable)
@@ -290,8 +290,8 @@ git.check_repo_or_die()
 top = vfs.RefList(None)
 
 if not extra:
-    o.fatal('must specify at least one filename to restore')
-    
+    o.fatal('Must specify at least one filename to restore')
+
 exclude_rxs = parse_rx_excludes(flags, o.fatal)
 
 owner_map = {}
index 7a9bb2dc5289d8d4d24decc6bba972b1cd9b8ccf..82c31b4971857bff4d3fa276d79fe55f2fc390d5 100755 (executable)
@@ -31,9 +31,9 @@ o = options.Options(optspec)
 
 git.check_repo_or_die()
 if not (opt.tree or opt.commit or opt.name):
-    o.fatal("use one or more of -t, -c, -n")
+    o.fatal("Use one or more of -t, -c, -n")
 if not extra:
-    o.fatal("no filenames given")
+    o.fatal("No filenames given")
 
 opt.progress = (istty2 and not opt.quiet)
 opt.smaller = parse_num(opt.smaller or 0)
@@ -60,15 +60,15 @@ if opt.graft:
         if option == "--graft":
             splitted_parameter = parameter.split('=')
             if len(splitted_parameter) != 2:
-                o.fatal("a graft point must be of the form old_path=new_path")
+                o.fatal("A graft point must be of the form old_path=new_path")
             old_path, new_path = splitted_parameter
             if not (old_path and new_path):
-                o.fatal("a graft point cannot be empty")
+                o.fatal("A graft point cannot be empty")
             graft_points.append((realpath(old_path), realpath(new_path)))
 
 is_reverse = os.environ.get('BUP_SERVER_REVERSE')
 if is_reverse and opt.remote:
-    o.fatal("don't use -r in reverse mode; it's automatic")
+    o.fatal("Don't use -r in reverse mode; it's automatic")
 
 if opt.name and opt.name.startswith('.'):
     o.fatal("'%s' is not a valid branch name" % opt.name)
index a7f00ba8cd0857bcc4c04f08e2e685c56135f894..b2995848d564fe0344a67189bb21c7a8bbe21124 100755 (executable)
@@ -169,7 +169,7 @@ o = options.Options(optspec)
 (opt, flags, extra) = o.parse(sys.argv[1:])
 
 if extra:
-    o.fatal('no arguments expected')
+    o.fatal('No arguments expected')
 
 debug2('bup server: Reading from stdin.')
 
index a9ab8363087ebc3f31e6a9eff1d693bf1de794a8..790d4d8dd7ee85744ec15b2da3db79938984a879 100755 (executable)
@@ -37,14 +37,14 @@ handle_ctrl_c()
 git.check_repo_or_die()
 if not (opt.blobs or opt.tree or opt.commit or opt.name or
         opt.noop or opt.copy):
-    o.fatal("use one or more of -b, -t, -c, -n, --noop, --copy")
+    o.fatal("Use one or more of -b, -t, -c, -n, --noop, --copy")
 if (opt.noop or opt.copy) and (opt.blobs or opt.tree or
                                opt.commit or opt.name):
     o.fatal('--noop and --copy are incompatible with -b, -t, -c, -n')
 if opt.blobs and (opt.tree or opt.commit or opt.name):
     o.fatal('-b is incompatible with -t, -c, -n')
 if extra and opt.git_ids:
-    o.fatal("don't provide filenames when using --git-ids")
+    o.fatal("Don't provide filenames when using --git-ids")
 
 if opt.verbose >= 2:
     git.verbose = opt.verbose - 1
@@ -80,11 +80,11 @@ def prog(filenum, nbytes):
 
 is_reverse = os.environ.get('BUP_SERVER_REVERSE')
 if is_reverse and opt.remote:
-    o.fatal("don't use -r in reverse mode; it's automatic")
+    o.fatal("Don't use -r in reverse mode; it's automatic")
 start_time = time.time()
 
 if opt.name and opt.name.startswith('.'):
-    o.fatal("'%s' is not a valid branch name." % opt.name)
+    o.fatal("'%s' is not a valid branch name" % opt.name)
 refname = opt.name and 'refs/heads/%s' % opt.name or None
 if opt.noop or opt.copy:
     cli = pack_writer = oldref = None
index f89f1c2f648c59d91e7aa3c654f75aecc6320eef..4442b6d6962c6163a4234484f408c1f35721798b 100755 (executable)
@@ -43,11 +43,11 @@ if not extra:
         print t
     sys.exit(0)
 elif len(extra) < 2:
-    o.fatal('no commit ref or hash given.')
+    o.fatal('No commit ref or hash given.')
 
 (tag_name, commit) = extra[:2]
 if not tag_name:
-    o.fatal("tag name must not be empty.")
+    o.fatal("Tag name must not be empty")
 debug1("Parameters: Tag name = %s; commit = %s" % (tag_name, commit))
 
 if tag_name in tags and not opt.force:
@@ -55,7 +55,7 @@ if tag_name in tags and not opt.force:
     sys.exit(1)
 
 if tag_name.startswith('.'):
-    o.fatal("'%s' is not a valid tag name." % tag_name)
+    o.fatal("'%s' is not a valid tag name" % tag_name)
 
 try:
     hash = git.rev_parse(commit)
index 4d462ad7fe501188a1843f12062acf037b3a392a..926dc4a100dc504840af0f86becbb2671b7c1660 100755 (executable)
@@ -9,7 +9,7 @@ o = options.Options(optspec)
 (opt, flags, extra) = o.parse(sys.argv[1:])
 
 if extra:
-    o.fatal("no arguments expected")
+    o.fatal("No arguments expected")
 
 t = time.time()
 tleft = 1 - (t - int(t))
index 645f25f5ac68cc848c3daf805f74a7d7ab1a1ebc..58c5f29cc56651df971da9a721d4c9864f0deb40 100755 (executable)
@@ -16,7 +16,7 @@ o = options.Options(optspec)
 
 total = (opt.date or 0) + (opt.commit or 0) + (opt.tag or 0)
 if total > 1:
-    o.fatal('at most one option expected')
+    o.fatal('At most one option expected')
 
 
 def version_date():
index 6450e1a8e3b30170a19e121380aa9b51fa0b301f..35abc949139ffaae305da0c755cde384171e52a3 100755 (executable)
@@ -192,7 +192,7 @@ o = options.Options(optspec)
 (opt, flags, extra) = o.parse(sys.argv[1:])
 
 if len(extra) > 1:
-    o.fatal("at most one argument expected")
+    o.fatal("At most one argument expected")
 
 address = ('127.0.0.1', 8080)
 if len(extra) > 0:
index 9794a802498c89bd2b4a83fb2d447e4f2e5a91da..ca951e58aef31986e3866ff49d05376cd8c233e0 100755 (executable)
@@ -15,10 +15,10 @@ def parse_timestamp_arg(field, value):
         res = parse_timestamp(res)
     except ValueError, ex:
         if ex.args:
-            o.fatal('unable to parse %s resolution "%s" (%s)'
+            o.fatal('Unable to parse %s resolution "%s" (%s)'
                     % (field, value, ex))
         else:
-            o.fatal('unable to parse %s resolution "%s"' % (field, value))
+            o.fatal('Unable to parse %s resolution "%s"' % (field, value))
 
     if res != 1 and res % 10:
         o.fatal('%s resolution "%s" must be a power of 10' % (field, value))
index bc5306c9356c895d6ae7a771c9e4096e08250fce..054646775e1c7fff79b39fb56663678d72d9b51b 100755 (executable)
@@ -80,9 +80,9 @@ WVPASS force-delete "$BUP_DIR" src restore
 WVPASS bup init
 WVPASS mkdir src
 WVFAIL bup save --graft =/grafted -n graft-point-absolute src 2>&1 \
-    | WVPASS grep 'error: a graft point cannot be empty'
+    | WVPASS grep 'Error: A graft point cannot be empty!'
 WVFAIL bup save --graft $top/$tmp= -n graft-point-absolute src 2>&1 \
-    | WVPASS grep 'error: a graft point cannot be empty'
+    | WVPASS grep 'Error: A graft point cannot be empty!'
 
 
 WVSTART "save --graft /x/y=/a/b (relative paths)"