shafreeck / cortana Goto Github PK
View Code? Open in Web Editor NEWcortana gives you a new style to write command line programs
License: Apache License 2.0
cortana gives you a new style to write command line programs
License: Apache License 2.0
cortana:"long, short, default, description"
demo default is single value, but how to set like: a,b,c
// ...
func help() {
cortana.Title("hello, welcome to cortana")
cortana.Usage()
}
func main() {
cortana.AddRootCommand(help)
cortana.AddCommand("say hello cortana", sayHelloCortana, "say hello to cortana")
cortana.AddCommand("say hello", sayHelloAnyone, "say hello to anyone")
cortana.AddCommand("say", sayAnything, "say anything to anyone")
cortana.Alias("cortana", "say hello cortana")
cortana.AddConfig("greeting.json", cortana.UnmarshalFunc(json.Unmarshal))
cortana.Use(cortana.ConfFlag("--config", "-c", cortana.UnmarshalFunc(json.Unmarshal)))
cortana.Launch()
}
say
和 say -h
的执行结果是一致的
我看了下内部执行逻辑好像也是这样的?
Given
example --id 1 --id 2 --id3
opts := struct{
id []string `cortana:"--id"`
} {}
Parse the ids into opts.id
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.