一个用于构建完整且强大 CLI 命令的 Ruby 工具包。
A modular Ruby toolkit for building clean, correct, and robust CLI commands as plain-old Ruby classes.
mycmd | head).TERM=dumb and NO_COLOR).NO_COLOR
is set.--help/help.less).~/.config/, ~/.local/share/, ~/.cache/).#main or #run.$ gem install command_kitgem.add_dependency 'command_kit', '~> 0.3'gem 'command_kit', '~> 0.3'…#!/usr/bin/env ruby
$LOAD_PATH.unshift(File.expand_path('../../lib',__FILE__))
require 'foo/cli/my_cmd'
Foo::CLI::MyCmd.startUsage: my_cmd [OPTIONS] [-o OUTPUT] FILE
Options:
-c, --count INT Number of times (Default: 1)
-o, --output FILE Optional output file
-v, --verbose Increase verbose level
-h, --help Print help information
Arguments:
FILE Input file
Examples:
my_cmd -o path/to/output.txt path/to/input.txt
my_cmd -v -c 2 -o path/to/output.txt path/to/input.txt
Example command…Special thanks to everyone who answered my questions and gave feedback on Twitter.
Copyright (c) 2021-2025 Hal Brodigan
See {file:LICENSE.txt} for details.
暂无开放 Issues,或尚未同步最近议题。