# # patch "ChangeLog" # from [44f992b708acdf2ef940290bd0b72b7efaf01f3e] # to [dbd0d33e4b73daff78a6a4a606fd43f181cb5695] # # patch "commands.cc" # from [61185ae5cc7cd776c25ca1655199a314bdd40378] # to [d04179187700889eee2af3e4e6ada1ffad5e7317] # # patch "monotone.cc" # from [21be582ccd322a35a5d1864ee1251e5773054619] # to [cab8b2b01a23a5e82a37761b90517703c57c241a] # ======================================================================== --- ChangeLog 44f992b708acdf2ef940290bd0b72b7efaf01f3e +++ ChangeLog dbd0d33e4b73daff78a6a4a606fd43f181cb5695 @@ -1,3 +1,8 @@ +2005-09-26 Matt Johnston + + * commands.cc: add 'help' command + * monotone.cc: add -h alias for --help + 2005-09-25 Matt Johnston * netsync.cc: use lexical_cast on port numbers to avoid ======================================================================== --- commands.cc 61185ae5cc7cd776c25ca1655199a314bdd40378 +++ commands.cc d04179187700889eee2af3e4e6ada1ffad5e7317 @@ -318,6 +318,19 @@ system_path path; }; + +CMD(help, N_("informative"), N_("command [ARGS...]"), N_("display command help"), OPT_NONE) +{ + if (args.size() < 1) + throw usage(""); + + string full_cmd = complete_command(idx(args, 0)()); + if (cmds.find(full_cmd) == cmds.end()) + throw usage(""); + + throw usage(full_cmd); +} + static void maybe_update_inodeprints(app_state & app) { ======================================================================== --- monotone.cc 21be582ccd322a35a5d1864ee1251e5773054619 +++ monotone.cc cab8b2b01a23a5e82a37761b90517703c57c241a @@ -79,7 +79,7 @@ {"debug", 0, POPT_ARG_NONE, NULL, OPT_DEBUG, gettext_noop("print debug log to stderr while running"), NULL}, {"dump", 0, POPT_ARG_STRING, &argstr, OPT_DUMP, gettext_noop("file to dump debugging log to, on failure"), NULL}, {"quiet", 0, POPT_ARG_NONE, NULL, OPT_QUIET, gettext_noop("suppress log and progress messages"), NULL}, - {"help", 0, POPT_ARG_NONE, NULL, OPT_HELP, gettext_noop("display help message"), NULL}, + {"help", 'h', POPT_ARG_NONE, NULL, OPT_HELP, gettext_noop("display help message"), NULL}, {"version", 0, POPT_ARG_NONE, NULL, OPT_VERSION, gettext_noop("print version number, then exit"), NULL}, {"full-version", 0, POPT_ARG_NONE, NULL, OPT_FULL_VERSION, gettext_noop("print detailed version number, then exit"), NULL}, {"xargs", '@', POPT_ARG_STRING, &argstr, OPT_ARGFILE, gettext_noop("insert command line arguments taken from the given file"), NULL},