Documentation ¶
Overview ¶
Package gen generates github.com/motemen/go-cli.Command from function docs in files specified.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
Generate reads source file for command actions with their usage documentations and writes Go code that registers the command to cli.
Usage documentation should be like below:
// +command <name> - <short> // // <usage line> // // <long description>... func action(flags *flag.FlagSet, args []string) { }
Currently, generated files will be like below:
// auto-generated file package main import "github.com/motemen/go-cli" func init() { cli.Use( &cli.Command{ Name: "foo", ... } ) ... }
You can define `main action` without sub-command. Usage documentation of main action should be like below:
// +main - <short> // // <usage line> // // <long description>... func mainAction(flags *flag.FlagSet, args []string) { ... }
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.