diff --git a/README.md b/README.md index 8181194..ea41455 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ The isolated comment blocks like below: ``` import ( - "fmt" + "fmt" // this line is isolated comment // those lines belong to one @@ -67,10 +67,10 @@ Now GCI provides two command line methods, mainly for backward compatibility. GCI supports three modes of operation > **Note** -> -> Since v0.10.0, the `-s` and `--section` flag can only be used multiple times to specify multiple sections. -> For example, you could use `-s standard,default` before, but now you must use `-s standard -s default`. -> This breaking change makes it possible for the project to support specifying multiple custom prefixes. (Please see below.) +> +> Since v0.10.0, the `-s` and `--section` flag can only be used multiple times to specify multiple sections. +> For example, you could use `-s standard,default` before, but now you must use `-s standard -s default`. +> This breaking change makes it possible for the project to support specifying multiple custom prefixes. (Please see below.) ```shell @@ -93,6 +93,7 @@ Flags: blank - blank section, contains all blank imports. --skip-generated Skip generated files --custom-order Enable custom order of sections. If specified, make the section order the same as your configuration order. The default order is standard > default > custom > blank > dot. + --format-always Format the file even if no imports are defined. By default, formatting doesn't run when there are <= 1 imports. ``` ```shell @@ -188,9 +189,9 @@ Run `gci write -s standard -s default -s "prefix(github.com/daixiang0/gci)" main package main import ( "golang.org/x/tools" - + "fmt" - + "github.com/daixiang0/gci" ) ``` diff --git a/cmd/gci/gcicommand.go b/cmd/gci/gcicommand.go index 1795b12..deb9917 100644 --- a/cmd/gci/gcicommand.go +++ b/cmd/gci/gcicommand.go @@ -47,7 +47,7 @@ func (e *Executor) newGciCommand(use, short, long string, aliases []string, stdI e.rootCmd.AddCommand(&cmd) debug = cmd.Flags().BoolP("debug", "d", false, "Enables debug output from the formatter") - formatAlways = cmd.Flags().Bool("always-format", false, "Format the file even if no imports are defined.") + formatAlways = cmd.Flags().Bool("format-always", false, "Format the file even if no imports are defined.") sectionHelp := `Sections define how inputs will be processed. Section names are case-insensitive and may contain parameters in (). The section order is standard > default > custom > blank > dot. The default value is [standard,default]. standard - standard section that Go provides officially, like "fmt"