lib/branch/name/subcommands/nestable.rb in branch-name-3.2.1 vs lib/branch/name/subcommands/nestable.rb in branch-name-3.2.2
- old
+ new
@@ -13,36 +13,32 @@
base.extend ClassMethods
end
end
module ClassMethods
- def ancestor_name
+ def base_usage
raise NotImplementedError
end
# Thor override
+ # rubocop:disable Style/OptionHash
+ def desc(usage, description, options = {})
+ super "#{base_usage} #{usage} ", description, options
+ end
+ # rubocop:enable Style/OptionHash
+
+ # Thor override
# rubocop:disable Style/GlobalVars
# rubocop:disable Lint/UnusedMethodArgument
# rubocop:disable Style/OptionalBooleanParameter
def banner(command, namespace = nil, subcommand = false)
command.formatted_usage(self, $thor_runner, subcommand).split("\n").map do |_formatted_usage|
- "#{basename} #{@help_override[command.usage]}"
+ "#{basename} #{command.usage}"
end.join("\n")
end
# rubocop:enable Style/GlobalVars
# rubocop:enable Lint/UnusedMethodArgument
# rubocop:enable Style/OptionalBooleanParameter
-
- def help_override(help_string)
- if @usage.blank?
- raise 'Thor.desc must be called for the command that should ' \
- "be associated with \"#{help_string}\" prior to calling " \
- '.help_override'
- end
-
- @help_override = {} unless defined? @help_override
- @help_override[@usage] = help_string
- end
end
end
end
end
end