Sha256: 2b4417538aff88e542d8977d7d1836cf6e3674d67e86cd6a860ca9ddd0f7eb30
Contents?: true
Size: 814 Bytes
Versions: 15
Compression:
Stored size: 814 Bytes
Contents
#!/usr/bin/env ruby $: << File.expand_path('lib') <%= run sq(<<-'rb') 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 rb -%> <%= run "Cl.new('splat').run(%w(lft 1 2 3 4 5))" %> <%= out '[["1", "2", "3"], "4", "5"]' %> <%= run "Cl.new('splat').run(%w(mid 1 2 3 4 5))" %> <%= out '["1", ["2", "3", "4"], "5"]' %> <%= run "Cl.new('splat').run(%w(rgt 1 2 3 4 5))" %> <%= out '["1", "2", ["3", "4", "5"]]' %>
Version data entries
15 entries across 15 versions & 1 rubygems