Registry / cli / cmdparse

cmdparse

JSON →
library3.0.7rbrubygemsunverified

CmdParse provides classes for parsing (possibly nested) commands on the command line, using optparse for options.

gem install cmdparse
INSTALL
IMPORT
SIG · CMDPARSE
C
cmdparse
clirubyv3.0.7
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CmdParse
require 'cmdparse'

Define a simple command-line parser with a greet command

require 'cmdparse' parser = CmdParse::Parser.new(true, true) parser.add_command(CmdParse::Command.new('greet', takes_commands: false) do |cmd| cmd.add_optional('name', type: String) cmd.set_action do |args| puts "Hello, #{args[:name] || 'World'}!" end end) parser.parse(['greet', '--name', 'Ruby'])
Debug
Known issues

No known issues recorded.

Upgrade
Version history
3.0.7latest on RubyGems
Audit
Dependencies

No dependency data recorded yet.

Agent activity
22 hits · last 30 days
node
18
OpenAI (training)
1
Resources