diff --git a/dup.rb b/dup.rb index 26a3eaa..482e350 100755 --- a/dup.rb +++ b/dup.rb @@ -155,6 +155,15 @@ def run_cmd(cmd, ignore_returnvalue=false, catch_interrupt=false, ignore_dry_run return returnvalue end +def collect_commands(&block) + $commands = [] + def run_cmd(cmd, ignore_returnvalue=false, catch_interrupt=false, ignore_dry_run: false); $commands</dev/null") + run_cmd(cmd + " >/dev/null") self.connect_to_networks @@ -440,6 +448,7 @@ class Container data[name] = result end + @data = data return data end end @@ -506,6 +515,7 @@ opts.each do |opt, arg| $net_host = true when '--regenerate' action = :regenerate + needs_container = false when '--verbose' $verbose = true when '--all' @@ -533,6 +543,7 @@ elsif action == :update action_update(base_dir) elsif action == :regenerate action_regenerate(container) + container.each {|c| puts c.build_run_command} elsif action == :_completion action_completion($base_dir, completion_str) end