Project

rcoli

0.0
No commit activity in last 3 years
No release in over 3 years
The complete solution for commandline application written in ruby.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

~> 1.6.11
= 0.8.5
 Project Readme

Gem Version Dependency Status

RCoLi

Library for development of command line applications in Ruby.

== Installation

$ gem install rcoli

== Example

	#!/usr/bin/env ruby

	require 'rcoli'

	application("mytool") do
	  author "Operations Team"
	  version "1.0.0"
	  description "Tool for management of infrastructure"

	  flag short: 'd', long: 'debug' do |f|
	    f.description "Turn on debugging"
	  end
		
	  switch short: 'c', long: 'config' do |s|
	    s.description "Path of file with configuration"
	  end

	  command :node do |c|
	    c.description "Commands for creating and managing nodes"
	    c.command :create do |sc|
	      sc.description "Creates node"
	      sc.action do |opts, args|
				 # your action here
	      end
	    end
			
	    c.command :remove do |sc|
	      sc.description "Remove node"
	      sc.action do |opts, args|
				 # your action here
	      end
	    end
			
	  end
	end