- Added {CommandKit::Interactive#ask_multiline}.
- Added {CommandKit::Open}.
- Added {CommandKit::Options::VerboseLevel}.
- Fixed {CommandKit::Inflector.camelize} to convert
foo-1234-5678
toFoo_1234_5678
.
- Micro-optimization to {CommandKit::Printing::Indent#puts}.
- Ensure that the interactive prompt is re-printed when no input is entered and input is required from the user.
- Do not pass an Array of Regexp captures for an option's value Regexp type into an option's block, if the option's block only accepts one argument. Instead, only pass the option's value as a String.
- Fixed a bug where
Array
option values were only setting the option's value to the first element of the parsedArray
value.
- Fixed {CommandKit::Interactive#ask} to remove the newline from the read user input.
- Fixed the
--help
output for options with multi-line descriptions (ex:desc: ['Line 1', 'Line 2', ...]
).
- Switched to using
require_relative
to improve load-times. - Added
# frozen_string_literal: true
to all files.
- Added {CommandKit::Env::Shell}.
- Added {CommandKit::Env::Prefix}.
- Added {CommandKit::Completion::Install}.
- Added more examples of how to define sub-commands and sub-sub-commands.
- Do not override the command's
usage
if it's already been set.
- Format the table output as UTF-8 to allow UTF-8 data in the formatted table.
- Added {CommandKit::BugReport}.
- Added {CommandKit::Edit}.
- Added {CommandKit::Printing::Fields}.
- Added {CommandKit::Printing::Lists}.
- Added {CommandKit::Printing::Tables}.
- Support disabling ANSI color output if the
NO_COLOR
environment variable is set.
- Correct the option usage for long option flags that have optional values
(ex:
--longopt[=VALUE]
).
- Added {CommandKit::FileUtils}.
- Added {CommandKit::FileUtils#erb #erb}.
- Added {CommandKit::Colors::ANSI::RESET_FG RESET_FG}.
- Added {CommandKit::Colors::ANSI.bright_black bright_black}.
- Added {CommandKit::Colors::ANSI.gray gray}.
- Added {CommandKit::Colors::ANSI.bright_red bright_red}.
- Added {CommandKit::Colors::ANSI.bright_green bright_green}.
- Added {CommandKit::Colors::ANSI.bright_yellow bright_yellow}.
- Added {CommandKit::Colors::ANSI.bright_blue bright_blue}.
- Added {CommandKit::Colors::ANSI.bright_magenta bright_magenta}.
- Added {CommandKit::Colors::ANSI.bright_cyan bright_cyan}.
- Added {CommandKit::Colors::ANSI.bright_white bright_white}.
- Added {CommandKit::Colors::ANSI.on_bright_black on_bright_black}.
- Added {CommandKit::Colors::ANSI.on_gray on_gray}.
- Added {CommandKit::Colors::ANSI.on_bright_red on_bright_red}.
- Added {CommandKit::Colors::ANSI.on_bright_green on_bright_green}.
- Added {CommandKit::Colors::ANSI.on_bright_yellow on_bright_yellow}.
- Added {CommandKit::Colors::ANSI.on_bright_blue on_bright_blue}.
- Added {CommandKit::Colors::ANSI.on_bright_magenta on_bright_magenta}.
- Added {CommandKit::Colors::ANSI.on_bright_cyan on_bright_cyan}.
- Added {CommandKit::Colors::ANSI.on_bright_white on_bright_white}.
-
Allow grouping options into categories:
option :opt1, category: 'Foo Options', desc: 'Option 1' option :opt2, category: 'Foo Options', desc: 'Option 1'
-
Allow options to have multi-line descriptions:
option :opt1, short: '-o', desc: [ 'line1', 'line2', '...' ]
-
Allow arguments to have multi-line descriptions:
argument :arg1, desc: [ 'line1', 'line2', '...' ]
- Added {CommandKit::ProgramName#command_name}.
- Raise a
NotImplementedError
exception in {CommandKit::Help::Man#help_man #help_man} if {CommandKit::Help::Man::ClassMethods#man_dir .man_dir} was not set.
- Ensure that all error messages end with a period.
- Documentation fixes.
- Opt-in to rubygem.org MFA requirement.
- Auto-detect whether {CommandKit::CommandName#command_name #command_name} is available, and if so, prepend the command name to all error messages.
- Expand the path given to {CommandKit::Help::Man::ClassMethods#man_dir man_dir}.
- If {CommandKit::Help::Man::ClassMethods#man_dir man_dir} is not set, fallback
to regular
--help
output.
- Include {CommandKit::Usage} and {CommandKit::Printing} into {CommandKit::Arguments}.
- Include {CommandKit::Arguments} into {CommandKit::Options}.
- Ensure that {CommandKit::Options::Parser#main} runs before {CommandKit::Arguments#main}.
- Ensure that {CommandKit::Options#help} also calls {CommandKit::Arguments#help_arguments}.
- Always prepopulate {CommandKit::Options#options #options} with option's
default values.
- Note: if an option has a default value but the option's value is not
required (ex:
value: {required: false, default: "foo"}
), and the option's flag is given but no value is given (ex:--option-flag --some-other-flag
), the option's value in {CommandKit::Options#options #options} will benil
not the option's default value ("foo"
). This helps indicate that the option's flag was given but no value was given with it.
- Note: if an option has a default value but the option's value is not
required (ex:
- When a
Class
is passed to {CommandKit::Options::OptionValue.default_usage}, demodularize the class name before converting it to underscored/uppercase.
- Fixed the inclusion order of {CommandKit::Options} and {CommandKit::Arguments}.
- Define the
COMMAND
andARGS
arguments. - Correctly duplicate the {CommandKit::Env#env env} (which can be either
ENV
or aHash
) to work on ruby-3.1.0-preview1. - Print command aliases that were set explicitly
(ex:
command_aliases['rm'] = 'remove'
) in {CommandKit::Commands#help}. - Print help and exit with status
1
if no command is given. This matches the behavior of thegit
command.
- Ensure that any explicit command aliases are added to the command's {CommandKit::Commands::ClassMethods#command_aliases command_aliases}.
- Added {CommandKit::Colors::ANSI#on_black}.
- Added {CommandKit::Colors::ANSI#on_red}.
- Added {CommandKit::Colors::ANSI#on_green}.
- Added {CommandKit::Colors::ANSI#on_yellow}.
- Added {CommandKit::Colors::ANSI#on_blue}.
- Added {CommandKit::Colors::ANSI#on_magenta}.
- Added {CommandKit::Colors::ANSI#on_cyan}.
- Added {CommandKit::Colors::ANSI#on_white}.
- Added {CommandKit::Man}.
- Added {CommandKit::OS#bsd?}.
- Added {CommandKit::OS#freebsd?}.
- Added {CommandKit::OS#netbsd?}.
- Added {CommandKit::OS#openbsd?}.
- Added {CommandKit::OS#os}.
- Added {CommandKit::OS#unix?}.
- Added {CommandKit::OS::Linux}.
- Added {CommandKit::OpenApp}.
- Added {CommandKit::PackageManager}.
- Added {CommandKit::Pager#pipe_to_pager}.
- Added {CommandKit::Sudo}.
- Added {CommandKit::Terminal#tty?}.
- Refactor {CommandKit::Inflector.camelize} and {CommandKit::Inflector.underscore} to use StringScanner.
- Allow {CommandKit::OS#initialize} to accept an
os:
keyword to override the detected OS.
- Initial release:
- {CommandKit::Arguments}
- {CommandKit::Colors}
- {CommandKit::Command}
- {CommandKit::CommandName}
- {CommandKit::Commands}
- {CommandKit::Commands::AutoLoad}
- {CommandKit::Commands::AutoRequire}
- {CommandKit::Description}
- {CommandKit::Env}
- {CommandKit::Env::Home}
- {CommandKit::Env::Path}
- {CommandKit::Examples}
- {CommandKit::ExceptionHandler}
- {CommandKit::Help}
- {CommandKit::Help::Man}
- {CommandKit::Interactive}
- {CommandKit::Main}
- {CommandKit::Options}
- {CommandKit::Options::Quiet}
- {CommandKit::Options::Verbose}
- {CommandKit::OS}
- {CommandKit::Pager}
- {CommandKit::Printing}
- {CommandKit::Printing::Indent}
- {CommandKit::ProgramName}
- {CommandKit::Stdio}
- {CommandKit::Terminal}
- {CommandKit::Usage}
- {CommandKit::XDG}