summaryrefslogtreecommitdiff
path: root/lib/highline
diff options
context:
space:
mode:
author邹云慧 <1300698769@qq.com>2018-04-06 18:42:02 +0800
committerAbinoam P. Marques Jr <abinoam@gmail.com>2018-05-12 21:22:25 -0300
commitacf3d81f8fbeca7efde6b65d4c92c04ab9b70216 (patch)
treee249c2fdada5666778104b8af4444d6b26e724e2 /lib/highline
parent4d236c63e8c5ebcd72b2ee10a73da9108cb553fb (diff)
downloadhighline-acf3d81f8fbeca7efde6b65d4c92c04ab9b70216.tar.gz
about shell and gather
Diffstat (limited to 'lib/highline')
-rwxr-xr-x[-rw-r--r--]lib/highline/menu.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/highline/menu.rb b/lib/highline/menu.rb
index 5f73cd7..8029b49 100644..100755
--- a/lib/highline/menu.rb
+++ b/lib/highline/menu.rb
@@ -472,16 +472,22 @@ class HighLine
selected_items = selections.map do |selection|
find_item_from_selection(items, selection)
end
+ index = 0
selected_items.map do |selected_item|
- value_for_selected_item(selected_item, details)
+ value = value_for_selected_item(selected_item, self.shell ? details[index] : nil)
+ index += 1
+ value
end
end
def value_for_hash_selections(items, selections, details)
# Find the selected items and return in hash form
+ index = 0
selections.each_with_object({}) do |(key, selection), memo|
selected_item = find_item_from_selection(items, selection)
- memo[key] = value_for_selected_item(selected_item, details)
+ value = value_for_selected_item(selected_item, self.shell ? details[index] : nil)
+ index += 1
+ memo[key] = value
end
end