37 lines
671 B
Go
37 lines
671 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
|
||
|
"github.com/urfave/cli/v2"
|
||
|
"go.jolheiser.com/beaver"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
app := cli.NewApp()
|
||
|
app.Name = "Imp"
|
||
|
app.Usage = "Re-order imports"
|
||
|
app.Flags = []cli.Flag{
|
||
|
&cli.BoolFlag{
|
||
|
Name: "write",
|
||
|
Aliases: []string{"w"},
|
||
|
Usage: "Write the re-ordered imports instead of just printing them",
|
||
|
},
|
||
|
&cli.StringSliceFlag{
|
||
|
Name: "exclude",
|
||
|
Aliases: []string{"e"},
|
||
|
Usage: "A list of directories to exclude",
|
||
|
},
|
||
|
&cli.BoolFlag{
|
||
|
Name: "verbose",
|
||
|
Aliases: []string{"v"},
|
||
|
Usage: "Print more information",
|
||
|
},
|
||
|
}
|
||
|
app.Action = runImp
|
||
|
|
||
|
if err := app.Run(os.Args); err != nil {
|
||
|
beaver.Fatal(err)
|
||
|
}
|
||
|
}
|