jobala / commando Goto Github PK
View Code? Open in Web Editor NEWAn elegant Go CLI framework
License: MIT License
An elegant Go CLI framework
License: MIT License
Command help is shown when a user adds the --help
flag after a command. For Commando, I want to separate concerns between registering commands and command groups and their help information. Developers will define help in help.yaml file then commando will load the file and add help to the commands.
The yaml file should have the following format
parent child grand-child
type: command
short-summary: "grand-child help"
parameters:
- name: --body
short-summary: "itemBody"
long-summary: |
Usage: --body content=XX content-type=XX
content: The content of the item.
- name: --end
short-summary: "dateTimeTimeZone"
long-summary: |
Usage: --end date-time=XX time-zone=XX
Running parent child grand-child --help
will result in the output below
usage: parent child grand-child [-h|--help] --body <string> --end <string>
Arguments:
-h --help Print help information
--body itemBody
--end dateTimeTimeZone
Commando currently supports string and int flags and needs to support the following types
type args struct {
fname string `required`
lname string
}
func handler(input args) {
fmt.Printf("%s %s\n", input.fname, input.lname)
}
cli.Command("print", handler, args)
mg print --fname "Hello" --lname "World"
Hello World
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.