-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.md.ecr
58 lines (37 loc) · 1.46 KB
/
README.md.ecr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Kommando [![Crystal CI](https://github.com/Ragmaanir/kommando/actions/workflows/crystal.yml/badge.svg)](https://github.com/Ragmaanir/kommando/actions/workflows/crystal.yml)
### Version <%= Kommando::VERSION %>
Kommando is a library that helps you build small and large command line interfaces in crystal.
## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
kommando:
github: ragmaanir/kommando
```
## Features
- positional arguments (like in `crystal init app MyApp`)
- short and long options (like `cli new MyProject --dry -v --permissions=644 --repo=github -l=MIT`)
- validation and type conversion of arguments
- auto-generated documentation
- namespaces/subcommands like `cli create user Toby`
## Rationale
**Why classes for commands and not methods**
Classes can define helper methods that are scoped to the command. And the helper methods have access to all options of the command.
## Usage
### Commands
```crystal
<%= File.read("./spec/examples/command.cr") %>
```
### Namespaces
```crystal
require "kommando"
<%= File.read("./spec/examples/namespace.cr") %>
```
## Contributing
1. Fork it (https://github.com/ragmaanir/kommando/fork)
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request
## Contributors
- [ragmaanir](https://github.com/ragmaanir) ragmaanir - creator, maintainer