Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cliqr

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cliqr

  • 2.2.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

cliqr Version

Build Coverage Quality Dependencies Inline docs Downloads

Table of Contents

Summary

cliqr is a lightweight yet feature rich framework which can be used to build a powerful command line application. It provides a easy to use DSL to define the interface of a application. Some of the features included:

  • Quick and easy method for defining CLI interface
  • Command usage generation based on interface definition
  • Argument parsing
  • Argument validation
  • Nested command actions
  • Multiple command handler based on arguments
  • Command routing to appropriate handler
  • Inbuilt shell extension for your command

Examples

The DSL provides several helper methods to build interfaces of different styles. Please refer to the examples folder to find some useful tips on how to use cliqr.

Quickstart

To get things started quickly here is an example of a basic cliqr based CLI application (lets call this script greet):

#!/usr/bin/env ruby

require 'cliqr'

cli = Cliqr.interface do
  name 'greet'
  description 'A "hello world" app to demonstrate cliqr.'
  version '0.0.1' # optional; adds a version action to our simple command

  # main command handler
  handler do
    puts "Hi #{name}" if name? # name is command's option defined below
    puts "Please tell me your name" unless name?
  end

  option :name do
    description 'Your name.'
  end
end

cli.execute(ARGV)

Here is a screen capture of this script in action: greet script demo

Installation

Add this line to your application's Gemfile:

gem 'cliqr'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cliqr

Building

There are various metric with different thresholds settings that needed to be satisfied for a successful build. Here is a list:

  • rubocop to make sure the code style checks are maintained
  • yardstick to measure document coverage
  • codeclimate to make we ship quality code
  • coveralls to measure code coverage
  • rdoc to build and measure documentation

To run all of the above, simply run:

$ rake

Contributing

  1. Fork it ( https://github.com/anshulverma/cliqr/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

FAQs

Package last updated on 28 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc