Skip to content

class_options in thor groups do not print in command help #661

Open
@pblesi

Description

@pblesi

Using this toy example:

#!/usr/bin/env ruby

require "thor"
require "thor/group"

class MyGroup < Thor::Group
  class_option :opt, aliases: :o, default: "1"

  def one
    puts options[:opt]
  end
end

class MyCLI < Thor
  register(MyGroup, "print_opt", "print_opt", "Prints the options")
end

MyCLI.start

And running:

bundle exec broken_class_options.rb help print_opt

Produces this output:

Usage:
  broken_class_options.rb print_opt

The class options are not printed for this group. This appears related to this issue: #402

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions