mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00

Improves consistency of capitalization and punctuation across various help text, plus some rewording and consolidating command groups.
26 lines
616 B
Ruby
26 lines
616 B
Ruby
class Pry::Command::ChangePrompt < Pry::ClassCommand
|
|
match 'change-prompt'
|
|
group 'Input and Output'
|
|
description 'Change the current prompt.'
|
|
command_options argument_required: true
|
|
banner <<-BANNER
|
|
Usage: change-prompt NAME
|
|
|
|
Change the current prompt. See list-prompts for a list of available
|
|
prompts.
|
|
BANNER
|
|
|
|
def process(prompt)
|
|
if prompt_map.key?(prompt)
|
|
_pry_.prompt = prompt_map[prompt][:value]
|
|
else
|
|
raise Pry::CommandError, "'#{prompt}' isn't a known prompt!"
|
|
end
|
|
end
|
|
|
|
private
|
|
def prompt_map
|
|
Pry::Prompt::MAP
|
|
end
|
|
Pry::Commands.add_command(self)
|
|
end
|