parameters
Version, currently 1.0.56 versions
github.com/erdnaxeli/crystal-parameters
Parse parameters from a string
0 stars
1 dependent
License: MIT
Installation
# Add this to your shard.yml
dependencies:
parameters:
github: erdnaxeli/crystal-parameters
version: ~> 1.0.5Then run:
shards installshard.yml
- Crystal
>=0.35.1, <2- License
- MIT
- Author
- Alexandre Morignot <
Dependencies
Development Dependencies
- ameba~>0.13.2github: crystal-ameba/amebadev
README
crystal-parameters
Parse parameters from a string and output a array of strings that is usable with
OptionParser#parse.
It is usefull on interactive app accepting complex commands, like text bots.
Installation
-
Add the dependency to your
shard.yml:dependencies: crystal-parameters: github: erdnaxeli/crystal-parameters -
Run
shards install
Usage
require "option_parser"
require "parameters"
parameters = Parameters.parse("ls -lh --author --hide '* *' /tmp")
# => ["ls", "-lh", "--author", "--hide", "* *", "/tmp"]
if parameters
OptionParser.parse(parameters) do |parser|
parser.on("ls", "list files") { }
end
end
Development
Make sure to run make test and make lint :)
Contributing
- Fork it (https://github.com/erdnaxeli/crystal-parameters/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- erdnaxeli - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
1.0.5- Tagged
- Apr 5, 2021
- Commit
fa57047f8b5d- Crystal
>=0.35.1, <2- Indexed
- yes
Dependents
Repository
github.com/erdnaxeli/crystal-parameters
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 18, 2026
- Synced
- Aug 18, 2026
- Versions
- 6