comparison mercurial/commands.py @ 593:ca3c499e94c6

Shorten help -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Shorten help Basic commands are now marked with "^" in the table only basic commands are show in hg help by default copyright banner not displayed with help by default manifest hash: 7337678588354ca669a3b13d1fbb0ad893563947 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCx9LNywK+sNU5EO8RAokCAJ9ZK2sGEto9RLyukFX+n0nzHRoB9QCfU84I e+Evc2g91kSS92FPrIC+Hnw= =yUmt -----END PGP SIGNATURE-----
author mpm@selenic.com
date Sun, 03 Jul 2005 03:58:05 -0800
parents 74175ce83378
children 9a8daeff0ffa
comparison
equal deleted inserted replaced
592:74175ce83378 593:ca3c499e94c6
213 ui.write(i[0].__doc__, "\n") 213 ui.write(i[0].__doc__, "\n")
214 except UnknownCommand: 214 except UnknownCommand:
215 ui.warn("hg: unknown command %s\n" % cmd) 215 ui.warn("hg: unknown command %s\n" % cmd)
216 sys.exit(0) 216 sys.exit(0)
217 else: 217 else:
218 if not ui.quiet: 218 if ui.verbose:
219 show_version(ui) 219 show_version(ui)
220 ui.write('\n') 220 ui.write('\n')
221 ui.write('hg commands:\n\n') 221 if ui.verbose:
222 ui.write('hg commands:\n\n')
223 else:
224 ui.write('basic hg commands (use -v for long list):\n\n')
222 225
223 h = {} 226 h = {}
224 for c, e in table.items(): 227 for c, e in table.items():
225 f = c.split("|")[0] 228 f = c.split("|")[0]
226 if f.startswith("debug"): 229 if not ui.verbose and not f.startswith("^"):
227 continue 230 continue
231 if not ui.debugflag and f.startswith("debug"):
232 continue
233 f = f.lstrip("^")
228 d = "" 234 d = ""
229 if e[0].__doc__: 235 if e[0].__doc__:
230 d = e[0].__doc__.splitlines(0)[0].rstrip() 236 d = e[0].__doc__.splitlines(0)[0].rstrip()
231 h[f] = d 237 h[f] = d
232 238
876 return repo.verify() 882 return repo.verify()
877 883
878 # Command options and aliases are listed here, alphabetically 884 # Command options and aliases are listed here, alphabetically
879 885
880 table = { 886 table = {
881 "add": (add, [], "hg add [files]"), 887 "^add": (add, [], "hg add [files]"),
882 "addremove": (addremove, [], "hg addremove [files]"), 888 "addremove": (addremove, [], "hg addremove [files]"),
883 "annotate": (annotate, 889 "annotate": (annotate,
884 [('r', 'revision', '', 'revision'), 890 [('r', 'revision', '', 'revision'),
885 ('u', 'user', None, 'show user'), 891 ('u', 'user', None, 'show user'),
886 ('n', 'number', None, 'show revision number'), 892 ('n', 'number', None, 'show revision number'),
887 ('c', 'changeset', None, 'show changeset')], 893 ('c', 'changeset', None, 'show changeset')],
888 'hg annotate [-u] [-c] [-n] [-r id] [files]'), 894 'hg annotate [-u] [-c] [-n] [-r id] [files]'),
889 "cat": (cat, [], 'hg cat <file> [rev]'), 895 "cat": (cat, [], 'hg cat <file> [rev]'),
890 "clone": (clone, [('U', 'noupdate', None, 'skip update after cloning')], 896 "^clone": (clone, [('U', 'noupdate', None, 'skip update after cloning')],
891 'hg clone [options] <source> [dest]'), 897 'hg clone [options] <source> [dest]'),
892 "commit|ci": (commit, 898 "^commit|ci": (commit,
893 [('t', 'text', "", 'commit text'), 899 [('t', 'text', "", 'commit text'),
894 ('A', 'addremove', None, 'run add/remove during commit'), 900 ('A', 'addremove', None, 'run add/remove during commit'),
895 ('l', 'logfile', "", 'commit text file'), 901 ('l', 'logfile', "", 'commit text file'),
896 ('d', 'date', "", 'date code'), 902 ('d', 'date', "", 'date code'),
897 ('u', 'user', "", 'user')], 903 ('u', 'user', "", 'user')],
899 "copy": (copy, [], 'hg copy <source> <dest>'), 905 "copy": (copy, [], 'hg copy <source> <dest>'),
900 "debugcheckdirstate": (debugcheckdirstate, [], 'debugcheckdirstate'), 906 "debugcheckdirstate": (debugcheckdirstate, [], 'debugcheckdirstate'),
901 "debugdumpdirstate": (debugdumpdirstate, [], 'debugdumpdirstate'), 907 "debugdumpdirstate": (debugdumpdirstate, [], 'debugdumpdirstate'),
902 "debugindex": (debugindex, [], 'debugindex <file>'), 908 "debugindex": (debugindex, [], 'debugindex <file>'),
903 "debugindexdot": (debugindexdot, [], 'debugindexdot <file>'), 909 "debugindexdot": (debugindexdot, [], 'debugindexdot <file>'),
904 "diff": (diff, [('r', 'rev', [], 'revision')], 910 "^diff": (diff, [('r', 'rev', [], 'revision')],
905 'hg diff [-r A] [-r B] [files]'), 911 'hg diff [-r A] [-r B] [files]'),
906 "export": (export, [('o', 'output', "", 'output to file')], 912 "export": (export, [('o', 'output', "", 'output to file')],
907 "hg export [-o file] <changeset> ..."), 913 "hg export [-o file] <changeset> ..."),
908 "forget": (forget, [], "hg forget [files]"), 914 "forget": (forget, [], "hg forget [files]"),
909 "heads": (heads, [], 'hg heads'), 915 "heads": (heads, [], 'hg heads'),
911 "identify|id": (identify, [], 'hg identify'), 917 "identify|id": (identify, [], 'hg identify'),
912 "import|patch": (import_, 918 "import|patch": (import_,
913 [('p', 'strip', 1, 'path strip'), 919 [('p', 'strip', 1, 'path strip'),
914 ('b', 'base', "", 'base path')], 920 ('b', 'base', "", 'base path')],
915 "hg import [options] <patches>"), 921 "hg import [options] <patches>"),
916 "init": (init, [], 'hg init'), 922 "^init": (init, [], 'hg init'),
917 "log|history": (log, 923 "^log|history": (log,
918 [('r', 'rev', [], 'revision')], 924 [('r', 'rev', [], 'revision')],
919 'hg log [-r A] [-r B] [file]'), 925 'hg log [-r A] [-r B] [file]'),
920 "manifest": (manifest, [], 'hg manifest [rev]'), 926 "manifest": (manifest, [], 'hg manifest [rev]'),
921 "parents": (parents, [], 'hg parents [node]'), 927 "parents": (parents, [], 'hg parents [node]'),
922 "pull": (pull, 928 "^pull": (pull,
923 [('u', 'update', None, 'update working directory')], 929 [('u', 'update', None, 'update working directory')],
924 'hg pull [options] [source]'), 930 'hg pull [options] [source]'),
925 "push": (push, [], 'hg push <destination>'), 931 "^push": (push, [], 'hg push <destination>'),
926 "rawcommit": (rawcommit, 932 "rawcommit": (rawcommit,
927 [('p', 'parent', [], 'parent'), 933 [('p', 'parent', [], 'parent'),
928 ('d', 'date', "", 'date code'), 934 ('d', 'date', "", 'date code'),
929 ('u', 'user', "", 'user'), 935 ('u', 'user', "", 'user'),
930 ('F', 'files', "", 'file list'), 936 ('F', 'files', "", 'file list'),
931 ('t', 'text', "", 'commit text'), 937 ('t', 'text', "", 'commit text'),
932 ('l', 'logfile', "", 'commit text file')], 938 ('l', 'logfile', "", 'commit text file')],
933 'hg rawcommit [options] [files]'), 939 'hg rawcommit [options] [files]'),
934 "recover": (recover, [], "hg recover"), 940 "recover": (recover, [], "hg recover"),
935 "remove|rm": (remove, [], "hg remove [files]"), 941 "^remove|rm": (remove, [], "hg remove [files]"),
936 "revert": (revert, 942 "revert": (revert,
937 [("n", "nonrecursive", None, "don't recurse into subdirs"), 943 [("n", "nonrecursive", None, "don't recurse into subdirs"),
938 ("r", "rev", "", "revision")], 944 ("r", "rev", "", "revision")],
939 "hg revert [files|dirs]"), 945 "hg revert [files|dirs]"),
940 "root": (root, [], "hg root"), 946 "root": (root, [], "hg root"),
941 "serve": (serve, [('p', 'port', 8000, 'listen port'), 947 "^serve": (serve, [('p', 'port', 8000, 'listen port'),
942 ('a', 'address', '', 'interface address'), 948 ('a', 'address', '', 'interface address'),
943 ('n', 'name', os.getcwd(), 'repository name'), 949 ('n', 'name', os.getcwd(), 'repository name'),
944 ('t', 'templates', "", 'template map')], 950 ('t', 'templates', "", 'template map')],
945 "hg serve [options]"), 951 "hg serve [options]"),
946 "status": (status, [], 'hg status'), 952 "^status": (status, [], 'hg status'),
947 "tag": (tag, [('t', 'text', "", 'commit text'), 953 "tag": (tag, [('t', 'text', "", 'commit text'),
948 ('d', 'date', "", 'date code'), 954 ('d', 'date', "", 'date code'),
949 ('u', 'user', "", 'user')], 955 ('u', 'user', "", 'user')],
950 'hg tag [options] <name> [rev]'), 956 'hg tag [options] <name> [rev]'),
951 "tags": (tags, [], 'hg tags'), 957 "tags": (tags, [], 'hg tags'),
952 "tip": (tip, [], 'hg tip'), 958 "tip": (tip, [], 'hg tip'),
953 "undo": (undo, [], 'hg undo'), 959 "undo": (undo, [], 'hg undo'),
954 "update|up|checkout|co": 960 "^update|up|checkout|co":
955 (update, 961 (update,
956 [('m', 'merge', None, 'allow merging of conflicts'), 962 [('m', 'merge', None, 'allow merging of conflicts'),
957 ('C', 'clean', None, 'overwrite locally modified files')], 963 ('C', 'clean', None, 'overwrite locally modified files')],
958 'hg update [options] [node]'), 964 'hg update [options] [node]'),
959 "verify": (verify, [], 'hg verify'), 965 "verify": (verify, [], 'hg verify'),