Merge pull request #116 from tbuehlmann/traefik-command-options
Properly pass traefik command options
This commit is contained in:
@@ -56,7 +56,7 @@ class Mrsk::Commands::Traefik < Mrsk::Commands::Base
|
||||
private
|
||||
def cmd_option_args
|
||||
if args = config.traefik["args"]
|
||||
optionize args
|
||||
optionize args, with: "="
|
||||
else
|
||||
[]
|
||||
end
|
||||
|
||||
@@ -24,8 +24,14 @@ module Mrsk::Utils
|
||||
end
|
||||
|
||||
# Returns a list of shell-dashed option arguments. If the value is true, it's treated like a value-less option.
|
||||
def optionize(args)
|
||||
args.collect { |(key, value)| [ "--#{key}", value == true ? nil : escape_shell_value(value) ] }.flatten.compact
|
||||
def optionize(args, with: nil)
|
||||
options = if with
|
||||
args.collect { |(key, value)| value == true ? "--#{key}" : "--#{key}#{with}#{escape_shell_value(value)}" }
|
||||
else
|
||||
args.collect { |(key, value)| [ "--#{key}", value == true ? nil : escape_shell_value(value) ] }
|
||||
end
|
||||
|
||||
options.flatten.compact
|
||||
end
|
||||
|
||||
# Copied from SSHKit::Backend::Abstract#redact to be available inside Commands classes
|
||||
|
||||
Reference in New Issue
Block a user