]> arthur.barton.de Git - bup.git/commitdiff
cmd/server: add a new 'help' command.
authorAvery Pennarun <apenwarr@gmail.com>
Sun, 13 Feb 2011 05:56:29 +0000 (21:56 -0800)
committerAvery Pennarun <apenwarr@gmail.com>
Sun, 13 Feb 2011 05:56:29 +0000 (21:56 -0800)
Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
cmd/server-cmd.py

index a5e9abde18de074676fb4ddbc12a3ace734434f7..5c9858a7503770c15d282e7c0eebfb3c38a2a60b 100755 (executable)
@@ -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,