]> arthur.barton.de Git - bup.git/blobdiff - main.py
Bloom filter & server index: Hide some progress messages
[bup.git] / main.py
diff --git a/main.py b/main.py
index 45a0e8a14ae30b62013d0fe187ff94f0348c35b2..d7dc1eba5dabfd522727a7ae42a50f9cb339da4a 100755 (executable)
--- a/main.py
+++ b/main.py
@@ -31,7 +31,8 @@ os.environ['WIDTH'] = str(tty_width())
 
 def usage(msg=""):
     log('Usage: bup [-?|--help] [-d BUP_DIR] [--debug] [--profile] '
-        '<command> [options...]\n\n')
+        '<command> [options...]')
+    log('')
     common = dict(
         ftp = 'Browse backup sets using an ftp-like client',
         fsck = 'Check backup sets for damage and add redundancy information',
@@ -45,12 +46,12 @@ def usage(msg=""):
         web = 'Launch a web server to examine backup sets',
     )
 
-    log('Common commands:\n')
+    log('Common commands:')
     for cmd,synopsis in sorted(common.items()):
-        log('    %-10s %s\n' % (cmd, synopsis))
-    log('\n')
-    
-    log('Other available commands:\n')
+        log('    %-10s %s' % (cmd, synopsis))
+    log('')
+
+    log('Other available commands:')
     cmds = []
     for c in sorted(os.listdir(cmdpath) + os.listdir(exepath)):
         if c.startswith('bup-') and c.find('.') < 0:
@@ -58,12 +59,12 @@ def usage(msg=""):
             if cname not in common:
                 cmds.append(c[4:])
     log(columnate(cmds, '    '))
-    log('\n')
-    
+
     log("See 'bup help COMMAND' for more information on " +
-        "a specific command.\n")
+        "a specific command.")
     if msg:
-        log("\n%s\n" % msg)
+        log('')
+        log("%s" % msg)
     sys.exit(99)
 
 
@@ -75,7 +76,7 @@ try:
     optspec = ['help', 'version', 'debug', 'profile', 'bup-dir=']
     global_args, subcmd = getopt.getopt(argv[1:], '?VDd:', optspec)
 except getopt.GetoptError, ex:
-    usage('error: %s' % ex.msg)
+    usage('Error: %s!' % ex.msg)
 
 help_requested = None
 do_profile = False
@@ -93,7 +94,7 @@ for opt in global_args:
     elif opt[0] in ['-d', '--bup-dir']:
         os.environ['BUP_DIR'] = opt[1]
     else:
-        usage('error: unexpected option "%s"' % opt[0])
+        usage('Error: Unexpected option "%s"!' % opt[0])
 
 # Make BUP_DIR absolute, so we aren't affected by chdir (i.e. save -C, etc.).
 if 'BUP_DIR' in os.environ:
@@ -123,7 +124,7 @@ def subpath(s):
 
 subcmd[0] = subpath(subcmd_name)
 if not os.path.exists(subcmd[0]):
-    usage('error: unknown command "%s"' % subcmd_name)
+    usage('Error: Unknown command "%s"!' % subcmd_name)
 
 already_fixed = atoi(os.environ.get('BUP_FORCE_TTY'))
 if subcmd_name in ['mux', 'ftp', 'help']:
@@ -156,7 +157,7 @@ p = None
 forward_signals = True
 
 def handler(signum, frame):
-    debug1('\nbup: signal %d received\n' % signum)
+    debug1('bup: Signal %d received!' % signum)
     if not p or not forward_signals:
         return
     if signum != signal.SIGTSTP:
@@ -190,7 +191,7 @@ try:
             forward_signals = False
             break
     except OSError, e:
-        log('%s: %s\n' % (subcmd[0], e))
+        log('%s: %s' % (subcmd[0], e))
         ret = 98
 finally:
     if p and p.poll() == None: