From: Avery Pennarun Date: Sun, 13 Feb 2011 05:56:29 +0000 (-0800) Subject: cmd/server: add a new 'help' command. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=b3ce65db1ea314a32fa436f7874f72516e813249;p=packages%2Fb%2Fbup.git cmd/server: add a new 'help' command. Signed-off-by: Avery Pennarun --- diff --git a/cmd/server-cmd.py b/cmd/server-cmd.py index a5e9abd..5c9858a 100755 --- a/cmd/server-cmd.py +++ b/cmd/server-cmd.py @@ -6,6 +6,12 @@ from bup.helpers import * suspended_w = None dumb_server_mode = False + +def do_help(conn, junk): + conn.write('Commands:\n %s\n' % '\n '.join(sorted(commands))) + conn.ok() + + def _set_mode(): global dumb_server_mode dumb_server_mode = os.path.exists(git.repo('bup-dumb-server')) @@ -156,6 +162,8 @@ if extra: debug2('bup server: reading from stdin.\n') commands = { + 'quit': None, + 'help': do_help, 'init-dir': init_dir, 'set-dir': set_dir, 'list-indexes': list_indexes,