Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pepabo/facade
A utility that provides git-like sub command feature with one line of code
https://github.com/pepabo/facade
Last synced: about 1 month ago
JSON representation
A utility that provides git-like sub command feature with one line of code
- Host: GitHub
- URL: https://github.com/pepabo/facade
- Owner: pepabo
- Created: 2015-03-14T15:45:03.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-10-15T01:56:34.000Z (about 9 years ago)
- Last Synced: 2023-03-24T00:35:25.892Z (almost 2 years ago)
- Language: Go
- Homepage:
- Size: 155 KB
- Stars: 10
- Watchers: 207
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# façade
This library adds a git-like sub command feature into your command.
## Usage
Just call `facade.Run()` in your main file like below:
```go
package mainimport (
"github.com/pepabo/facade"
)func main() {
f := &facade.Facade{}// If `Env` set, the key-values will be injected into the environment
// variables which affects sub command.
f.Env = map[string]string{
"FACADE_FOO": "123",
"FACADE_BAR": "Bar Value",
}
f.Run()
}
```## Sub Command
1. If you name your command `your-command` and run it with `your-command foo bar baz`, façade regards `foo` as sub command and the rest of the arguments as ones for the sub command.
2. Then execute `your-command-foo` with arguments `bar baz`.## Builtin Commands
façade provides some builtin commands.
### `help`
Shows usage of the command.
### `list`
Lists up all sub commands.
## Logging
façade takes over STDOUT and STDERR of sub command and emits outputs from them in some pretty manner.
## License
MIT