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

5
dup.rb
View File

@ -115,6 +115,7 @@ def action_help
puts "-l, --list Lists all available containers." 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 " --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 " --regenerate Generates YAML content from a running container."
puts " --all Use all containers defined in yml files."
puts "-v, --verbose More verbose output." puts "-v, --verbose More verbose output."
exit 1 exit 1
end end
@ -442,10 +443,12 @@ opts.each do |opt, arg|
action = :regenerate action = :regenerate
when '--verbose' when '--verbose'
$verbose = true $verbose = true
when '--all'
container = Dir[$base_dir + "/*.yml"].sort.map{|f| Container.new(File.basename(f, ".yml"))}
end end
end end
container = ARGV.map{|c| Container.new(c)} container ||= ARGV.map{|c| Container.new(c)}
if needs_container if needs_container
if container.empty? if container.empty?