Module: Doing::Completion
- Defined in:
- lib/doing/completion.rb,
lib/doing/completion/zsh_completion.rb,
lib/doing/completion/bash_completion.rb,
lib/doing/completion/fish_completion.rb,
lib/doing/completion/completion_string.rb
Overview
Completion script generator
Defined Under Namespace
Modules: StringUtils Classes: BashCompletions, FishCompletions, ZshCompletions
Constant Summary collapse
- OPTIONS_RX =
/(?:-(?<short>\w), )?(?:--(?:\[no-\])?(?<long>\w+)(?:=(?<arg>\w+))?)\s+- (?<desc>.*?)$/.freeze
- SECTIONS_RX =
/(?m-i)^([A-Z ]+)\n([\s\S]*?)(?=\n+[A-Z]+|\Z)/.freeze
- COMMAND_RX =
/^(?<cmd>[^, \t]+)(?<alias>(?:, [^, \t]+)*)?\s+- (?<desc>.*?)$/.freeze
Class Method Summary collapse
-
.generate_completion(type: 'zsh', file: :default, link: true) ⇒ Object
Generate a completion script and output to file or stdout.
- .get_help_sections(command = '') ⇒ Object
- .install_builtin(type) ⇒ Object
- .link_default(type) ⇒ Object
- .normalize_type(type) ⇒ Object
- .parse_command(command) ⇒ Object
- .parse_commands(commands) ⇒ Object
- .parse_option(option) ⇒ Object
- .parse_options(options) ⇒ Object
Class Method Details
.generate_completion(type: 'zsh', file: :default, link: true) ⇒ Object
Generate a completion script and output to file or stdout