This repository has been archived on 2023-11-08. You can view files and clone it, but cannot push or open issues/pull-requests.
2020-05-06 22:05:00 +00:00
|
|
|
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.BoolFlag{
|
|
|
|
Name: "verbose",
|
|
|
|
Aliases: []string{"v"},
|
|
|
|
Usage: "Print more information",
|
|
|
|
},
|
2020-05-07 01:00:12 +00:00
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "imp-ignore",
|
|
|
|
Aliases: []string{"i"},
|
|
|
|
Usage: "Path to a .impignore file for globs",
|
|
|
|
Value: ".impignore",
|
|
|
|
},
|
2020-05-06 22:05:00 +00:00
|
|
|
}
|
|
|
|
app.Action = runImp
|
|
|
|
|
|
|
|
if err := app.Run(os.Args); err != nil {
|
|
|
|
beaver.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|