# # # patch "cmd.hh" # from [2859b4bf8f7e098484eabb78f3ad80a52ca33e25] # to [07379521d59289f04b4f7210c251848b49994b09] # # patch "commands.cc" # from [c171f10bf256a2a1c94536f8cf942b77baea82c8] # to [2ed6719c947da1c106b61ddfd36b3101ef012c7a] # # patch "commands.hh" # from [42fb189d08be5911d7214224cfb3a839256b4d4f] # to [2f69ed33b4afae4b66a48e17dc18c8e4dc5e6014] # # patch "monotone.cc" # from [d694be98990cdee4061475fba5000692c5bc95a0] # to [0412eca9b37f0e931c92ef71d128d760f4f98eb6] # ============================================================ --- cmd.hh 2859b4bf8f7e098484eabb78f3ad80a52ca33e25 +++ cmd.hh 07379521d59289f04b4f7210c251848b49994b09 @@ -79,8 +79,7 @@ namespace commands bool has_name(utf8 const & name) const; void complete_child_name(utf8 const & prefix, std::set< utf8 > & matches) const; - command * find_child_by_components(std::vector< utf8 > const & cs, - std::vector< utf8 > & rest); + command * find_child_by_components(std::vector< utf8 > const & cs); command * find_child_by_name(utf8 const & name) const; }; }; ============================================================ --- commands.cc c171f10bf256a2a1c94536f8cf942b77baea82c8 +++ commands.cc 2ed6719c947da1c106b61ddfd36b3101ef012c7a @@ -316,8 +316,7 @@ namespace commands { } command * - command::find_child_by_components(vector< utf8 > const & cs, - vector< utf8 > & rest) + command::find_child_by_components(vector< utf8 > const & cs) { command * cmd = this; @@ -338,12 +337,6 @@ namespace commands { I(cmd != NULL); } - if (iter != cs.end()) - { - rest.clear(); - rest.insert(rest.end(), iter, cs.end()); - } - return cmd; } @@ -382,17 +375,14 @@ namespace commands namespace commands { command_id - complete_command(args_vector const & args, - args_vector & rest) + complete_command(args_vector const & args) { command * root = CMD_REF(__root__); I(root != NULL); vector< utf8 > utf8args(args.begin(), args.end()); - vector< utf8 > utf8rest; - command * cmd = root->find_child_by_components(utf8args, utf8rest); - rest = args_vector(utf8rest.begin(), utf8rest.end()); + command * cmd = root->find_child_by_components(utf8args); I(cmd != NULL); return cmd->ident(); } @@ -567,8 +557,7 @@ namespace commands void explain_usage(command_id const & ident, ostream & out) { - vector< utf8 > rest; // XXX - if (CMD_REF(__root__)->find_child_by_components(ident, rest) != CMD_REF(__root__)) + if (CMD_REF(__root__)->find_child_by_components(ident) != CMD_REF(__root__)) explain_cmd_usage("", out); // XXX else { @@ -590,19 +579,18 @@ namespace commands int process(app_state & app, string const & cmd, args_vector const & args) { - args_vector a1, a2; + args_vector a1; a1.push_back(arg_type("merge_into_dir")); command_id ident; - ident = commands::complete_command(a1, a2); + ident = commands::complete_command(a1); 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(__root__)->find_child_by_components(ident, rest); - I(rest.size() == 0); + command * cmd = CMD_REF(__root__)->find_child_by_components(ident); + I(cmd->children().size() == 0); if (cmd != NULL) { L(FL("executing command '%s'") % join_words(ident)); ============================================================ --- commands.hh 42fb189d08be5911d7214224cfb3a839256b4d4f +++ commands.hh 2f69ed33b4afae4b66a48e17dc18c8e4dc5e6014 @@ -24,8 +24,7 @@ namespace commands { typedef std::vector< utf8 > command_id; void explain_usage(command_id const & cmd, std::ostream & out); - command_id complete_command(args_vector const & args, - args_vector & rest); + command_id complete_command(args_vector const & args); int process(app_state & app, std::string const & ident, args_vector const & args); int process(app_state & app, command_id const & ident, ============================================================ --- monotone.cc d694be98990cdee4061475fba5000692c5bc95a0 +++ monotone.cc 0412eca9b37f0e931c92ef71d128d760f4f98eb6 @@ -136,8 +136,7 @@ commands::command_id read_options(option // consume the command, and perform completion if necessary if (!opts.args.empty()) { - args_vector rest; - cmd = commands::complete_command(args, rest); + cmd = commands::complete_command(args); N(!cmd.empty(), F("unknown command '%s'") % join_words(args)()); }