# # # patch "cmd.hh" # from [91febddd8c375ccdca90fd9fb8ff2d2e48966355] # to [aab85d512e79e5dbc56f67a2c4b4bb5f3b991219] # # patch "cmd_automate.cc" # from [e5c1e8e82c3ee925973289f71dace7d1d2c5cac4] # to [537f5acaa0a125536e271ad9f704c7f2f182aca8] # # patch "cmd_netsync.cc" # from [1ae829e2d3422fa24d0eac1ff2c1ad9ec9a2a6b2] # to [ce40d6901889bc628c54a759b95f9feee72bfcba] # # patch "cmd_ws_commit.cc" # from [2377cf24799c95b98017f037562f549429f83ed9] # to [29a6c986bcffcfe66fa39f1461b3c985a654280c] # # patch "lua_hooks.cc" # from [4f197236fdae655d5cf3af020f4207fc79988cf4] # to [ff4053ed166f572c179628ec23c9ef263484e234] # ============================================================ --- cmd.hh 91febddd8c375ccdca90fd9fb8ff2d2e48966355 +++ cmd.hh aab85d512e79e5dbc56f67a2c4b4bb5f3b991219 @@ -12,7 +12,6 @@ #include #include -#include #include "commands.hh" #include "options.hh" @@ -83,9 +82,8 @@ namespace commands bool operator<(command const & cmd) const; virtual void exec(app_state & app, - command_id const & execid, - args_vector const & args, - std::ostream & output = std::cout) const = 0; + command_id const & execid, + args_vector const & args) const = 0; bool has_name(utf8 const & name) const; command const * find_command(command_id const & id) const; @@ -117,10 +115,14 @@ namespace commands std::string const & desc, options::options_type const & opts); - virtual void exec(app_state & app, + void exec(app_state & app, command_id const & execid, args_vector const & args, - std::ostream & output = std::cout) const; + std::ostream & output) const; + + void exec(app_state & app, + command_id const & execid, + args_vector const & args) const; }; }; @@ -189,15 +191,13 @@ namespace commands { {} \ virtual void exec(app_state & app, \ command_id const & execid, \ - args_vector const & args, \ - std::ostream & output = std::cout) const; \ + args_vector const & args) const; \ }; \ cmd_ ## C C ## _cmd; \ } \ void commands::cmd_ ## C::exec(app_state & app, \ command_id const & execid, \ - args_vector const & args, \ - std::ostream & output) const + args_vector const & args) const #define CMD(C, name, aliases, parent, params, abstract, desc, opts) \ _CMD2(C, name, aliases, parent, false, params, abstract, desc, opts) @@ -216,15 +216,13 @@ void commands::cmd_ ## C::exec(app_state {} \ virtual void exec(app_state & app, \ command_id const & execid, \ - args_vector const & args, \ - std::ostream & output = std::cout) const; \ + args_vector const & args) const; \ }; \ cmd_ ## C C ## _cmd; \ } \ void commands::cmd_ ## C::exec(app_state & app, \ command_id const & execid, \ - args_vector const & args, \ - std::ostream & output) const \ + args_vector const & args) const \ { \ I(false); \ } @@ -250,15 +248,13 @@ namespace commands { {} \ virtual void exec(app_state & app, \ command_id const & execid, \ - args_vector const & args, \ - std::ostream & output = std::cout) const; \ + args_vector const & args) const; \ }; \ cmd_ ## C C ## _cmd; \ } \ void commands::cmd_ ## C::exec(app_state & app, \ command_id const & execid, \ - args_vector const & args, \ - std::ostream & output) const + args_vector const & args) const // TODO: 'abstract' and 'desc' should be refactored so that the // command definition allows the description of input/output format, ============================================================ --- cmd_automate.cc e5c1e8e82c3ee925973289f71dace7d1d2c5cac4 +++ cmd_automate.cc 537f5acaa0a125536e271ad9f704c7f2f182aca8 @@ -52,6 +52,14 @@ namespace commands { make_io_binary(); exec_from_automate(args, execid, app, output); } + + void + automate::exec(app_state & app, + command_id const & execid, + args_vector const & args) const + { + exec(app, execid, args, std::cout); + } } static string const interface_version = "5.0"; ============================================================ --- cmd_netsync.cc 1ae829e2d3422fa24d0eac1ff2c1ad9ec9a2a6b2 +++ cmd_netsync.cc ce40d6901889bc628c54a759b95f9feee72bfcba @@ -173,7 +173,7 @@ CMD_AUTOMATE(push, "to the netsync server at the address ADDRESS."), options::opts::none) { - commands::push_cmd.exec(app, execid, args, output); + commands::push_cmd.exec(app, execid, args); } CMD(pull, "pull", "", CMD_REF(network), @@ -203,7 +203,7 @@ CMD_AUTOMATE(pull, "from the netsync server at the address ADDRESS."), options::opts::none) { - commands::pull_cmd.exec(app, execid, args, output); + commands::pull_cmd.exec(app, execid, args); } CMD(sync, "sync", "", CMD_REF(network), @@ -231,7 +231,7 @@ CMD_AUTOMATE(sync, "with the netsync server at the address ADDRESS."), options::opts::none) { - commands::sync_cmd.exec(app, execid, args, output); + commands::sync_cmd.exec(app, execid, args); } class dir_cleanup_helper ============================================================ --- cmd_ws_commit.cc 2377cf24799c95b98017f037562f549429f83ed9 +++ cmd_ws_commit.cc 29a6c986bcffcfe66fa39f1461b3c985a654280c @@ -1231,7 +1231,7 @@ CMD(commit, "commit", "ci", CMD_REF(work | options::opts::date | options::opts::author | options::opts::depth | options::opts::exclude) { - commit(app, execid, args, output, false); + commit(app, execid, args, std::cout, false); } // outputs the branch followed a newline followed by the new revision id: ============================================================ --- lua_hooks.cc 4f197236fdae655d5cf3af020f4207fc79988cf4 +++ lua_hooks.cc ff4053ed166f572c179628ec23c9ef263484e234 @@ -980,17 +980,13 @@ namespace commands { CMD_REF(user)->children().insert(this); } - void exec(app_state & app, - command_id const & execid, - args_vector const & args, - std::ostream & output) const; + void exec(app_state & app, command_id const & execid, args_vector const & args) const; }; } void commands::cmd_lua::exec(app_state & app, command_id const & execid, - args_vector const & args, - std::ostream & output) const + args_vector const & args) const { I(st); I(app.lua.check_lua_state(st));