diff options
author | Yuji Yaginuma <yuuji.yaginuma@gmail.com> | 2019-03-15 08:24:19 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-15 08:24:19 +0900 |
commit | 1cdc6c6576afe9a9fa67a6b313080a7dc62188d9 (patch) | |
tree | a09d66331fc1739ee7a65b66c545c98720b06503 /railties/lib/rails/commands/credentials/credentials_command.rb | |
parent | 85984e50311b7138504abe1be9bbe99f96dde8ef (diff) | |
parent | c801b232bcb5d885e846e33e26becd33631b8c5b (diff) | |
download | rails-1cdc6c6576afe9a9fa67a6b313080a7dc62188d9.tar.gz rails-1cdc6c6576afe9a9fa67a6b313080a7dc62188d9.tar.bz2 rails-1cdc6c6576afe9a9fa67a6b313080a7dc62188d9.zip |
Merge pull request #35599 from y-yagi/improve_environment_argument_handling
Properly expand the environment's name in all commands
Diffstat (limited to 'railties/lib/rails/commands/credentials/credentials_command.rb')
-rw-r--r-- | railties/lib/rails/commands/credentials/credentials_command.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/railties/lib/rails/commands/credentials/credentials_command.rb b/railties/lib/rails/commands/credentials/credentials_command.rb index 54ccd97506..a22b1f3f84 100644 --- a/railties/lib/rails/commands/credentials/credentials_command.rb +++ b/railties/lib/rails/commands/credentials/credentials_command.rb @@ -2,14 +2,15 @@ require "active_support" require "rails/command/helpers/editor" +require "rails/command/environment_argument" module Rails module Command class CredentialsCommand < Rails::Command::Base # :nodoc: include Helpers::Editor + include EnvironmentArgument - class_option :environment, aliases: "-e", type: :string, - desc: "Uses credentials from config/credentials/:environment.yml.enc encrypted by config/credentials/:environment.key key" + self.environment_desc = "Uses credentials from config/credentials/:environment.yml.enc encrypted by config/credentials/:environment.key key" no_commands do def help @@ -20,6 +21,7 @@ module Rails end def edit + extract_environment_option_from_argument(default_environment: nil) require_application! ensure_editor_available(command: "bin/rails credentials:edit") || (return) @@ -37,6 +39,7 @@ module Rails end def show + extract_environment_option_from_argument(default_environment: nil) require_application! say credentials.read.presence || missing_credentials_message |