Skip to content

0.2.1

Choose a tag to compare

@postmodern postmodern released this 04 Jan 09:36
· 175 commits to main since this release
v0.2.1

CommandKit::Printing

  • Auto-detect whether CommandKit::CommandName#command_name #command_name is
    available, and if so, prepend the command name to all error messages.

CommandKit::Help::Man

  • 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.

CommandKit::Arguments

  • Include CommandKit::Usage and CommandKit::Printing into
    CommandKit::Arguments.

CommandKit::Options

  • 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 be `nil`
      not the option's default value (`"foo"`). This helps indicate that the
      option's flag was given but no value was given with it.

CommandKit::Options::OptionValue

  • When a Class is passed to CommandKit::Options::OptionValue.default_usage,
    demodularize the class name before converting it to underscored/uppercase.

CommandKit::Command

  • Fixed the inclusion order of CommandKit::Options and
    CommandKit::Arguments.

CommandKit::Commands

  • Define the COMMAND and ARGS arguments.
  • Correctly duplicate the CommandKit::Env#env env (which can be either ENV
    or a Hash) 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 the git command.

CommandKit::Commands::AutoLoad

  • Ensure that any explicit command aliases are added to the command's
    CommandKit::Commands::ClassMethods#command_aliases command_aliases.