jenkins-bot has submitted this change and it was merged.

Change subject: Show current values in vagrant config --list
......................................................................


Show current values in vagrant config --list

Change-Id: Ibc028df155e07502078b0847b7cdd90c7161f903
---
M features/config.feature
M lib/mediawiki-vagrant/config.rb
2 files changed, 26 insertions(+), 4 deletions(-)

Approvals:
  Dduvall: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/features/config.feature b/features/config.feature
index d7cb790..3b7e030 100644
--- a/features/config.feature
+++ b/features/config.feature
@@ -31,6 +31,23 @@
       | forward_agent |
       | forward_x11   |
 
+  Scenario: Running `vagrant config --list` displays each setting's current 
value
+    Given the "http_port" setting is "8081"
+    When I run `vagrant config --list`
+    Then the command should have completed successfully
+    And the output should contain:
+      """
+      Current value: 8081
+      """
+
+  Scenario: Running `vagrant config --list` indicates current default values
+    When I run `vagrant config --list`
+    Then the command should have completed successfully
+    And the output should contain:
+      """
+      Current value: 8080 (default)
+      """
+
   Scenario: Running `vagrant config name value` configures a setting
     When I run `vagrant config foo bar`
     Then the command should have completed successfully
diff --git a/lib/mediawiki-vagrant/config.rb b/lib/mediawiki-vagrant/config.rb
index db42097..1802577 100644
--- a/lib/mediawiki-vagrant/config.rb
+++ b/lib/mediawiki-vagrant/config.rb
@@ -146,10 +146,15 @@
     # Lists all defined settings and their currently set values.
     #
     def list_settings
-      Settings.definitions.reject { |_, setting| setting.internal? }.each do 
|name, setting|
-        @env.ui.info "#{name}\t#{setting.description}", :bold => true
-        @env.ui.info indent(setting.help, 2) unless setting.help.nil?
-        @env.ui.info ""
+      configure do |settings|
+        settings.reject { |_, setting| setting.internal? }.each do |name, 
setting|
+          @env.ui.info "#{name}\t#{setting.description}", :bold => true
+          @env.ui.info indent(setting.help, 2) unless setting.help.nil?
+          value_info = "Current value: #{setting.value}"
+          value_info += " (default)" unless setting.set?
+          @env.ui.info indent(value_info, 2)
+          @env.ui.info ""
+        end
       end
     end
 

-- 
To view, visit https://gerrit.wikimedia.org/r/234827
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibc028df155e07502078b0847b7cdd90c7161f903
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza <gti...@wikimedia.org>
Gerrit-Reviewer: BryanDavis <bda...@wikimedia.org>
Gerrit-Reviewer: Dduvall <dduv...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to