parameters
Version, currently 1.0.16 versions
github.com/erdnaxeli/crystal-parameters
Parse parameters from a string
Nothing has been indexed for 1.0.1 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
parameters:
github: erdnaxeli/crystal-parameters
version: ~> 1.0.1Then run:
shards installshard.yml
No shard.yml has been indexed for 1.0.1. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
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.1- Tagged
- Apr 5, 2021
- Commit
d26adfad889e- Indexed
- not yet
Dependents
Repository
github.com/erdnaxeli/crystal-parameters
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 18, 2026
- Synced
- Aug 18, 2026
- Versions
- 6