Skip to content

Commit fc5380a

Browse files
committed
pass format keyword parameter as option when filtering CLI commands.
1 parent a083623 commit fc5380a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/rdf/cli.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,8 @@ def self.exec(args, output: $stdout, option_parser: nil, messages: {}, **options
572572
# @param [Hash{Symbol => Object}] options already set
573573
# @return [Array<String>] list of executable commands
574574
# @overload commands(format: :json, **options)
575-
# @param [:json] format (:json)
575+
# Returns commands as JSON, for API usage.
576+
# @param [:json] format
576577
# @param [Hash{Symbol => Object}] options already set
577578
# @return [Array{Object}]
578579
# Returns an array of commands including the command symbol
@@ -593,7 +594,7 @@ def self.commands(format: nil, **options)
593594
# Subset commands based on filter options
594595
cmds = COMMANDS.reject do |k, c|
595596
c.fetch(:filter, {}).any? do |opt, val|
596-
options[opt].to_s != val.to_s
597+
options.merge(format: format)[opt].to_s != val.to_s
597598
end
598599
end
599600

0 commit comments

Comments
 (0)