Sha256: 1bebda32aabdb30a700c66d21580a2788f841bc639976d7b95542ec0b4a6596a
Contents?: true
Size: 614 Bytes
Versions: 16
Compression:
Stored size: 614 Bytes
Contents
#!/usr/bin/env ruby $: << File.expand_path('lib') require 'cl' class Lft < Cl::Cmd arg :a, type: :array, splat: true arg :b arg :c def run p [a, b, c] end end class Mid < Cl::Cmd arg :a arg :b, type: :array, splat: true arg :c def run p [a, b, c] end end class Rgt < Cl::Cmd arg :a arg :b arg :c, type: :array, splat: true def run p [a, b, c] end end Cl.new('splat').run(%w(lft 1 2 3 4 5)) Cl.new('splat').run(%w(mid 1 2 3 4 5)) Cl.new('splat').run(%w(rgt 1 2 3 4 5)) # => # [["1", "2", "3"], "4", "5"] # ["1", ["2", "3", "4"], "5"] # ["1", "2", ["3", "4", "5"]]
Version data entries
16 entries across 16 versions & 1 rubygems