summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBarrett Ingram <bingram@eab.com>2020-03-22 14:43:20 -0500
committerBarrett Ingram <bingram@eab.com>2020-03-22 14:43:20 -0500
commita164846c4dc69386432a19a684ea64c2a9e737b5 (patch)
treeaa49fac24fb64c4e70b6a5b4a2cdbb8295e2b8b9 /lib
parent0b3b71e71415f9e7a234fe97466c61d9641dc7da (diff)
downloadpry-a164846c4dc69386432a19a684ea64c2a9e737b5.tar.gz
Improve help listing for regex aliases
This commit improves the appearance of regex aliases in the help index by storing the result of calling #inspect on the regex as the listing. For example, consider the `whereami` alias `/whereami[!?]+/`. Previously this would appear in the help index as `(?-mix:whereami[!?]+)`. This commit fixes this so it appears as `/whereami[!?]+/`.
Diffstat (limited to 'lib')
-rw-r--r--lib/pry/command_set.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pry/command_set.rb b/lib/pry/command_set.rb
index 70ec2e53..339e6424 100644
--- a/lib/pry/command_set.rb
+++ b/lib/pry/command_set.rb
@@ -193,7 +193,7 @@ class Pry
options = original_options.merge!(
desc: "Alias for `#{action}`",
- listing: match
+ listing: match.is_a?(String) ? match : match.inspect
).merge!(options)
# ensure default description is used if desc is nil