chore: clean up aliases

main
sudo pacman -Syu 2022-08-16 14:29:59 +07:00
parent cf46654fb5
commit 6b485d44d4
No known key found for this signature in database
GPG Key ID: D6CB5C6C567C47B0
1 changed files with 5 additions and 9 deletions

14
main.go
View File

@ -24,13 +24,7 @@ const (
licenseFilename = "LICENSE"
)
var (
// command aliases
generateAliases = []string{"gen"}
// flag aliases
outputAliases = []string{"o"}
)
var commandGenerateAliases = []string{"gen", "g"}
func main() {
a := action{}
@ -41,12 +35,11 @@ func main() {
Commands: []*cli.Command{
{
Name: commandGenerateName,
Aliases: generateAliases,
Aliases: commandGenerateAliases,
Usage: commandGenerateUsage,
Flags: []cli.Flag{
&cli.StringFlag{
Name: flagOutputName,
Aliases: outputAliases,
Usage: flagOutputUsage,
DefaultText: currentDir,
},
@ -97,4 +90,7 @@ func (a *action) RunGenerate(c *cli.Context) error {
func (a *action) getFlags(c *cli.Context) {
a.flags.output = c.String(flagOutputName)
if a.flags.output == "" {
a.flags.output = currentDir
}
}