Skip to content

Commit 43bf5e5

Browse files
committed
Handle CLI argument callback with arity 0 or > 2.
1 parent 013015f commit 43bf5e5

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/rdf/cli.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,10 @@ def initialize(symbol: nil, on: nil, datatype: nil, control: nil,
127127
def call(arg, options = {})
128128
if @callback
129129
case @callback.arity
130+
when 0 then @callback.call
130131
when 1 then @callback.call(arg)
131132
when 2 then @callback.call(arg, options)
133+
else arg
132134
end
133135
else
134136
arg

0 commit comments

Comments
 (0)