https://github.com/CocoaPods/CLAide
A small command-line interface framework.
https://github.com/CocoaPods/CLAide
Keywords from Contributors
cocoapods dependency-manager mac objective-c deployment ci fastlane screenshots apps activerecord
Last synced: about 13 hours ago
JSON representation
Repository metadata
A small command-line interface framework.
- Host: GitHub
- URL: https://github.com/CocoaPods/CLAide
- Owner: CocoaPods
- License: mit
- Created: 2012-10-22T21:04:32.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2024-02-07T16:59:01.000Z (almost 2 years ago)
- Last Synced: 2025-11-21T22:25:36.550Z (about 2 months ago)
- Language: Ruby
- Homepage:
- Size: 467 KB
- Stars: 197
- Watchers: 17
- Forks: 32
- Open Issues: 0
- Releases: 19
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
README.md
Hi, I’m Claide, your command-line tool aide.
I was born out of a need for a simple option and command parser, while still
providing an API that allows you to quickly create a full featured command-line
interface.
Install
$ [sudo] gem install claide
Usage
For full documentation, on the API of CLAide, visit rubydoc.info.
Argument handling
At its core, a library, such as myself, needs to parse the parameters specified
by the user.
Working with parameters is done through the CLAide::ARGV class. It takes an
array of parameters and parses them as either flags, options, or arguments.
| Parameter | Description |
|---|---|
--milk, --no-milk |
A boolean ‘flag’, which may be negated. |
--sweetener=honey |
An ‘option’ consists of a key, a ‘=’, and a value. |
tea |
An ‘argument’ is just a value. |
Accessing flags, options, and arguments, with the following methods, will also
remove the parameter from the remaining unprocessed parameters.
argv = CLAide::ARGV.new(['tea', '--no-milk', '--sweetener=honey'])
argv.shift_argument # => 'tea'
argv.shift_argument # => nil
argv.flag?('milk') # => false
argv.flag?('milk') # => nil
argv.option('sweetener') # => 'honey'
argv.option('sweetener') # => nil
In case the requested flag or option is not present, nil is returned. You can
specify a default value to be used as the optional second method parameter:
argv = CLAide::ARGV.new(['tea'])
argv.flag?('milk', true) # => true
argv.option('sweetener', 'sugar') # => 'sugar'
Unlike flags and options, accessing all of the arguments can be done in either
a preserving or mutating way:
argv = CLAide::ARGV.new(['tea', 'coffee'])
argv.arguments # => ['tea', 'coffee']
argv.arguments! # => ['tea', 'coffee']
argv.arguments # => []
Command handling
Commands are actions that a tool can perform. Every command is represented by
its own command class.
Commands may be nested, in which case they inherit from the ‘super command’
class. Some of these nested commands may not actually perform any work
themselves, but are rather used as ‘super commands’ only, in which case they
are ‘abtract commands’.
Running commands is typically done through the CLAide::Command.run(argv)
method, which performs the following three steps:
-
Parses the given parameters, finds the command class matching the parameters,
and instantiates it with the remaining parameters. It’s each nested command
class’ responsibility to remove the parameters it handles from the remaining
parameters, before calling thesuperimplementation. -
Asks the command instance to validate its parameters, but only after
calling thesuperimplementation. Thesuperimplementation will show a
help banner in case the--helpflag is specified, not all parameters were
removed from the parameter list, or the command is an abstract command. -
Calls the
runmethod on the command instance, where it may do its work. -
Catches any uncaught exception and shows it to user in a meaningful way.
- A
Helpexception triggers a help banner to be shown for the command. - A exception that includes the
InformativeErrormodule will show only
the message, unless disabled with the--verboseflag; and in red,
depending on the color configuration. - Any other type of exception will be passed to
Command.report_error(error)
for custom error reporting (such as the one in CocoaPods).
- A
In case you want to call commands from inside other commands, you should use
the CLAide::Command.parse(argv) method to retrieve an instance of the command
and call run on it. Unless you are using user-supplied parameters, there
should not be a need to validate the parameters.
See the example for a illustration of how to define commands.
Owner metadata
- Name: CocoaPods
- Login: CocoaPods
- Email:
- Kind: organization
- Description: A Swift & Objective C Dependency Manager
- Website: https://cocoapods.org
- Location:
- Twitter: CocoaPods
- Company:
- Icon url: https://avatars.githubusercontent.com/u/1189714?v=4
- Repositories: 69
- Last ynced at: 2024-10-30T03:50:16.591Z
- Profile URL: https://github.com/CocoaPods
GitHub Events
Total
- Issue comment event: 1
Last Year
- Issue comment event: 1
Committers metadata
Last synced: about 20 hours ago
Total Commits: 392
Total Committers: 21
Avg Commits per committer: 18.667
Development Distribution Score (DDS): 0.587
Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| Fabio Pelosin | f****n@g****m | 162 |
| Eloy Durán | e****e@g****m | 96 |
| Samuel Giddins | s****s@s****e | 58 |
| Olivier Halligon | o****r@h****t | 23 |
| Marius Rackwitz | g****t@m****e | 12 |
| Dimitris Koutsogiorgas | d****o@g****m | 7 |
| Danielle Tomlinson | d****n@t****o | 6 |
| Kyle Fuller | i****x@k****k | 5 |
| Olle Jonsson | o****n@g****m | 4 |
| Bas Broek | b****s@b****l | 2 |
| Clément Beffa | s****p@b****g | 2 |
| Eric Amorde | e****e@g****m | 2 |
| Les Hill | l****l@g****m | 2 |
| Nicolas Leger | n****r | 2 |
| Orta | o****x@g****m | 2 |
| dependabot[bot] | 4****] | 2 |
| Olivier Halligon | o****n@n****r | 1 |
| David Grandinetti | d****i@y****m | 1 |
| David Rodríguez | d****z@r****t | 1 |
| Kerri Miller | k****r@k****m | 1 |
| bootstraponline | c****e@b****m | 1 |
Committer domains:
- bootstraponline.com: 1
- kerrizor.com: 1
- riseup.net: 1
- yahoo-inc.com: 1
- niji.fr: 1
- beffa.org: 1
- basbroek.nl: 1
- kylefuller.co.uk: 1
- tomlinson.io: 1
- mariusrackwitz.de: 1
- halligon.net: 1
- segiddins.me: 1
Issue and Pull Request metadata
Last synced: 3 months ago
Total issues: 45
Total pull requests: 53
Average time to close issues: 4 months
Average time to close pull requests: 2 months
Total issue authors: 16
Total pull request authors: 22
Average comments per issue: 5.18
Average comments per pull request: 3.42
Merged pull request: 36
Bot issues: 0
Bot pull requests: 5
Past year issues: 0
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 0
Past year average comments per issue: 0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- fabiopelosin (18)
- segiddins (4)
- jcampbell05 (3)
- alloy (3)
- AliSoftware (3)
- bootstraponline (2)
- mrackwitz (2)
- kylef (2)
- keith (1)
- orta (1)
- luqyluqe (1)
- longv2go (1)
- mikehardy (1)
- LONGDDSF (1)
- Kasotot12 (1)
Top Pull Request Authors
- segiddins (16)
- fabiopelosin (6)
- dependabot[bot] (5)
- dnkoutso (3)
- leshill (2)
- bootstraponline (2)
- maclover7 (2)
- olleolleolle (2)
- GO-Institute (2)
- endocrimes (2)
- amorde (1)
- neonichu (1)
- deivid-rodriguez (1)
- orta (1)
- KrauseFx (1)
Top Issue Labels
- t1:enhancement (15)
- d1:easy (13)
- s1:awaiting input (7)
- s2:confirmed (6)
- t3:discussion (6)
- d2:moderate (4)
- s4:awaiting validation (3)
- s3:detailed (2)
- t2:defect (1)
Top Pull Request Labels
- dependencies (5)
- t1:enhancement (1)
- s4:awaiting validation (1)
- d2:moderate (1)
Package metadata
- Total packages: 2
-
Total downloads:
- rubygems: 434,149,613 total
- Total docker downloads: 956,279,598
- Total dependent packages: 85 (may contain duplicates)
- Total dependent repositories: 38,676 (may contain duplicates)
- Total versions: 50
- Total maintainers: 9
gem.coop: claide
A small command-line interface framework.
- Homepage: https://github.com/CocoaPods/CLAide
- Documentation: http://www.rubydoc.info/gems/claide/
- Licenses: MIT
- Latest release: 1.1.0 (published almost 4 years ago)
- Last Synced: 2026-01-06T06:16:33.636Z (1 day ago)
- Versions: 25
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 217,135,801 Total
- Docker Downloads: 478,139,799
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.082%
- Downloads: 0.114%
- Docker downloads count: 0.215%
- Maintainers (9)
rubygems.org: claide
A small command-line interface framework.
- Homepage: https://github.com/CocoaPods/CLAide
- Documentation: http://www.rubydoc.info/gems/claide/
- Licenses: MIT
- Latest release: 1.1.0 (published almost 4 years ago)
- Last Synced: 2026-01-05T08:25:35.788Z (2 days ago)
- Versions: 25
- Dependent Packages: 85
- Dependent Repositories: 38,676
- Downloads: 217,013,812 Total
- Docker Downloads: 478,139,799
-
Rankings:
- Downloads: 0.122%
- Dependent repos count: 0.167%
- Docker downloads count: 0.309%
- Dependent packages count: 0.367%
- Average: 1.599%
- Stargazers count: 4.061%
- Forks count: 4.566%
- Maintainers (9)
Dependencies
- bacon >= 0 development
- colored >= 0 development
- json < 3 development
- kicker >= 0 development
- mocha-on-bacon >= 0 development
- parallel <= 1.19.2 development
- prettybacon >= 0 development
- rubocop <= 0.81.0 development
- rubocop-performance <= 1.5.2 development
- simplecov >= 0 development
- rake >= 0
- ast 2.4.2
- bacon 1.2.0
- claide 1.1.0
- colored 1.2
- docile 1.1.5
- ffi 1.14.2
- jaro_winkler 1.5.4
- json 2.5.1
- kicker 3.0.0
- listen 1.3.1
- metaclass 0.0.4
- mocha 1.1.0
- mocha-on-bacon 0.2.2
- multi_json 1.10.1
- notify 0.5.2
- parallel 1.19.2
- parser 3.1.0.0
- prettybacon 0.0.2
- rainbow 3.0.0
- rake 10.3.2
- rb-fsevent 0.9.4
- rb-inotify 0.9.5
- rb-kqueue 0.2.3
- rexml 3.2.5
- rubocop 0.81.0
- rubocop-performance 1.5.2
- ruby-progressbar 1.11.0
- simplecov 0.9.1
- simplecov-html 0.8.0
- unicode-display_width 1.8.0
Score: 29.380633449638772