diff options
author | Barrett Ingram <bingram@eab.com> | 2020-03-22 14:43:20 -0500 |
---|---|---|
committer | Barrett Ingram <bingram@eab.com> | 2020-03-22 14:43:20 -0500 |
commit | a164846c4dc69386432a19a684ea64c2a9e737b5 (patch) | |
tree | aa49fac24fb64c4e70b6a5b4a2cdbb8295e2b8b9 /lib | |
parent | 0b3b71e71415f9e7a234fe97466c61d9641dc7da (diff) | |
download | pry-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.rb | 2 |
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 |