Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/waterlink/plugged
Library for writing extendable CLI applications for Golang.
https://github.com/waterlink/plugged
Last synced: 30 days ago
JSON representation
Library for writing extendable CLI applications for Golang.
- Host: GitHub
- URL: https://github.com/waterlink/plugged
- Owner: waterlink
- License: mit
- Created: 2015-10-15T20:18:32.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-16T01:34:06.000Z (about 9 years ago)
- Last Synced: 2024-10-16T07:16:17.830Z (3 months ago)
- Language: Go
- Size: 141 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# plugged
Library for writing extendable CLI applications.
## Usage
```go
import "github.com/waterlink/plugged"
```### "Gateway" application
```go
func main() {
plugged.Gateway("appname", "My super cli application.", os.Args)
}
```Example usage:
```bash
$ ./appname
USAGE: appname command [options]appname - My super cli application.
Available commands:
- find - Find some stuff.
- activate - Activate stuff.
- help - This help info.To get help for any of commands you can do `appname help command` or `appname
command --help`.
$ ./appname find --help
# .. here output of `appname-find --help` ..
```### Plugin application
```go
func main() {
plugged.Plugin("appname", "find", "Find some stuff.", os.Args, handler)
}func handler(args []string) {
// .. Find some stuff here ..
}
```## Installing plugin
Make sure you have installed plugin on your `PATH` and just run:
```bash
appname --plugged-install find
```## Plugin interface
Plugin does not necessary need to be written in `go` and/or using `plugged`
library. Instead it is required for a plugin to abide to the following
interface:```bash
appname-find --plugged-description # => Find some stuff.
appname-find --help # => .. help message ..
```## Development
You will need to have working recent `golang` installation (`1.5+` at a time of
writing). And the repo needs to be cloned into your `GOPATH`.- `go test` runs tests.
- Please follow TDD.## Contributing
1. Fork it ( https://github.com/waterlink/plugged/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
1. [waterlink](https://github.com/waterlink) - Oleksii Fedorov, creator,
maintainer.