+# after running 'bup newliner', the tty_width() ioctl won't work anymore
+os.environ['WIDTH'] = str(tty_width())
+
+def usage(msg=""):
+ log('Usage: bup [-?|--help] [-d BUP_DIR] [--debug] [--profile] '
+ '<command> [options...]\n\n')
+ common = dict(
+ ftp = 'Browse backup sets using an ftp-like client',
+ fsck = 'Check backup sets for damage and add redundancy information',
+ fuse = 'Mount your backup sets as a filesystem',
+ help = 'Print detailed help for the given command',
+ index = 'Create or display the index of files to back up',
+ on = 'Backup a remote machine to the local one',
+ restore = 'Extract files from a backup set',
+ save = 'Save files into a backup set (note: run "bup index" first)',
+ tag = 'Tag commits for easier access',
+ web = 'Launch a web server to examine backup sets',
+ )
+
+ log('Common commands:\n')
+ for cmd,synopsis in sorted(common.items()):
+ log(' %-10s %s\n' % (cmd, synopsis))
+ log('\n')
+
+ log('Other available commands:\n')
+ cmds = []
+ for c in sorted(os.listdir(cmdpath) + os.listdir(exepath)):