Added --all to regenerate all available containers.

This commit is contained in:
Fabian Schlenz 2020-09-04 06:13:10 +02:00
parent 61b3f2b98a
commit 33a8df5ac1
1 changed files with 4 additions and 1 deletions

5
dup.rb
View File

@ -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?