https://github.com/xe/eclier
A simple subcommand router for programs written in Go with Lua scripting
https://github.com/xe/eclier
Last synced: over 1 year ago
JSON representation
A simple subcommand router for programs written in Go with Lua scripting
- Host: GitHub
- URL: https://github.com/xe/eclier
- Owner: Xe
- License: cc0-1.0
- Created: 2017-11-04T13:15:08.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-06-08T23:05:08.000Z (about 7 years ago)
- Last Synced: 2025-03-26T14:39:09.189Z (over 1 year ago)
- Language: Go
- Size: 28.1 MB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eclier
Pronounced like eclair
The core of a command line application allowing for trivial user extension.
Every command and subcommand is its own `.lua` file that is either shipped as
part of the built-in cartridge of commands or a plugin that the user installs.
The core contains the following:
- A module loading system for preparing different commands for use
- The core subcommand router
## How to write plugins
Create a new file in the script home named after the plugin subcommand, for
example: `scripts/hello.lua`:
```lua
script.verb = "hello"
script.help = "prints everyone's favorite hello world message"
script.author = "Xe" -- put your github username here
script.version = "1.0"
script.usage = ""
function(run)
print "Hello, world!"
end
```
And then run it using the example shell cli:
```console
~/go/src/github.com/Xe/eclier:master λ go run ./example/main.go hello
Hello, world!
```