# # # patch "commands.cc" # from [8eeaceb818e213c1faeb66508a7d5406a2601d19] # to [fc85ba13a4c414a07b9db41ca16bfa841f69f9b3] # # patch "commands.hh" # from [5a82219ddcb3102278635ea3e41ff00dfc64b478] # to [1bb28efb43eab84cfda439f04ba931a138131f74] # # patch "monotone.cc" # from [3cee3701a32bae5c9842613601b83b5935fec357] # to [4d185e254cd053d66f61dc3871f8a0a49f80441a] # ============================================================ --- commands.cc 8eeaceb818e213c1faeb66508a7d5406a2601d19 +++ commands.cc fc85ba13a4c414a07b9db41ca16bfa841f69f9b3 @@ -606,24 +606,38 @@ namespace commands } } - int process(app_state & app, string const & name, args_vector const & args) + // XXX Must go away. + int process(app_state & app, string const & cmd, + args_vector const & args) { - command * cmd = NULL; + args_vector a1, a2; + a1.push_back(arg_type("merge_into_dir")); + command_id ident; + ident = commands::complete_command(a1, a2); + return process(app, ident, args); + } + + int process(app_state & app, command_id const & ident, + args_vector const & args) + { + vector< utf8 > rest; + command * cmd = CMD_REF(public)->find_child_by_components(ident, rest); + I(rest.size() == 0); if (cmd != NULL) { - L(FL("executing command '%s'") % name); + L(FL("executing command '%s'") % join_words(ident)); // at this point we process the data from _MTN/options if // the command needs it. if (cmd->use_workspace_options()) app.process_options(); - cmd->exec(app, "foo", args); + cmd->exec(app, join_words(ident)(), args); // XXX return 0; } else { - P(F("unknown command '%s'") % name); + P(F("unknown command '%s'") % join_words(ident)); return 1; } } ============================================================ --- commands.hh 5a82219ddcb3102278635ea3e41ff00dfc64b478 +++ commands.hh 1bb28efb43eab84cfda439f04ba931a138131f74 @@ -26,8 +26,10 @@ namespace commands { void explain_usage(std::string const & cmd, std::ostream & out); command_id complete_command(args_vector const & args, args_vector & rest); - int process(app_state & app, std::string const & cmd, + int process(app_state & app, std::string const & ident, args_vector const & args); + int process(app_state & app, command_id const & ident, + args_vector const & args); options::options_type command_options(args_vector const & cmdline); options::options_type toplevel_command_options(std::string const & cmd); }; ============================================================ --- monotone.cc 3cee3701a32bae5c9842613601b83b5935fec357 +++ monotone.cc 4d185e254cd053d66f61dc3871f8a0a49f80441a @@ -214,8 +214,6 @@ cpp_main(int argc, char ** argv) try { commands::command_id cmd = read_options(app.opts, args); - // XXX Remove cmdstr - string cmdstr = cmd.size() > 0 ? (*(cmd.begin()))() : ""; if (app.opts.version_given) { @@ -268,7 +266,7 @@ cpp_main(int argc, char ** argv) } else { - return commands::process(app, cmdstr, app.opts.args); + return commands::process(app, cmd, app.opts.args); } } catch (option::option_error const & e)