From 33a8df5ac13de0ea045513069485433dc3486b50 Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Fri, 4 Sep 2020 06:13:10 +0200 Subject: [PATCH] Added --all to regenerate all available containers. --- dup.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dup.rb b/dup.rb index 349ea0c..9369957 100755 --- a/dup.rb +++ b/dup.rb @@ -115,6 +115,7 @@ def action_help puts "-l, --list Lists all available containers." puts " --host Starts a container with net: host - which implies not using ports, networks and/or links." puts " --regenerate Generates YAML content from a running container." + puts " --all Use all containers defined in yml files." puts "-v, --verbose More verbose output." exit 1 end @@ -442,10 +443,12 @@ opts.each do |opt, arg| action = :regenerate when '--verbose' $verbose = true + when '--all' + container = Dir[$base_dir + "/*.yml"].sort.map{|f| Container.new(File.basename(f, ".yml"))} end end -container = ARGV.map{|c| Container.new(c)} +container ||= ARGV.map{|c| Container.new(c)} if needs_container if container.empty?