Sha256: a6205386d9c43283f8ad8e5ced56e31d9bd8a699b79b650fc1142defb76b9c54

Contents?: true

Size: 654 Bytes

Versions: 5

Compression:

Stored size: 654 Bytes

Contents

#!/usr/bin/env ruby
$: << File.expand_path('lib')

module Git
  class Pull < Cl::Cmd
    register :'git:pull'

    arg :branch

    def run
      p cmd: registry_key, args: args
    end
  end
end

# With this class registered (and assuming the executable that calls `Cl` is
# `bin/run`) the default runner would recognize and run it:
#
# $ bin/run git:pull master # instantiates Git::Pull, and passes ["master"] as args
# $ bin/run git pull master # does the same

Cl.new('run').run(%w(git:pull master))
# Output:
#
#   {:cmd=>:"git:pull", :args=>["master"]}

Cl.new('run').run(%w(git pull master))
# Output:
#
#   {:cmd=>:"git:pull", :args=>["master"]}

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
travis-cl-1.2.4 examples/readme/runner
cl-1.2.4 examples/readme/runner
cl-1.2.3 examples/readme/runner
cl-1.2.2 examples/readme/runner
cl-1.2.1 examples/readme/runner