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?