WIP optional tokens.
parent
df718d2a9e
commit
3349c3f251
|
@ -79,6 +79,8 @@ commands.push "add", "Adds a service to an environment." do |args|
|
|||
provider = service.get_default_provider token.token
|
||||
end
|
||||
|
||||
next if provider.nil? && token.optional
|
||||
|
||||
if provider.nil?
|
||||
STDERR.puts "This service consumes a “#{token.token}” token, but you have not specified what other service is supposed to provide it."
|
||||
STDERR.puts "Use the `service add #{args[1]} #{token.token}=<provider>` syntax to specify it."
|
||||
|
|
|
@ -4,6 +4,7 @@ require "specparser"
|
|||
class ServiceDefinition
|
||||
struct Consumes
|
||||
getter token : String
|
||||
getter optional : Bool
|
||||
def initialize(@token)
|
||||
@optional = false
|
||||
|
||||
|
|
Loading…
Reference in New Issue