Skip to content

Conversation

@jbourassa
Copy link

In our app, we have code that looks like:

class AppOpts < CLI::Kit::Opts
  def self.inherited(subclass)
    subclass.class_eval do
      def global_flag = flag(short: '-g', desc: 'some global flag')
    end
  end
end

class SomeCommand
  class Opts < AppOpts
    def specific = flag(short: '-s', desc: 'command specific flag')
  end
end

The options work as expected, but child options do not show up in --help because we loop through superclasses and only grab the direct children of CLI::Kit::Opts for documentation purpose. As we do that, we also accumualte method names into an array that's not read.

This looks like a bug / indead that never panned out, so I'm removing these lines.

In our app, we have code that looks like:

```ruby
class AppOpts < CLI::Kit::Opts
  def self.inherited(subclass)
    subclass.class_eval do
      def global_flag = flag(short: '-g', desc: 'some global flag')
    end
  end
end

class SomeCommand
  class Opts < AppOpts
    def specific = flag(short: '-s', desc: 'command specific flag')
  end
end
```

The options work as expected, but child options do not show up in
`--help` because we loop through superclasses and only grab the direct
children of `CLI::Kit::Opts` for documentation purpose. As we do that,
we also accumualte method names into an array that's not read.

This looks like a bug / indead that never panned out, so I'm removing
these lines.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant