Skip to content

Commit

Permalink
fixup! add readme + flag key update
Browse files Browse the repository at this point in the history
Signed-off-by: Jamy Timmermans <jamy@uber.com>
  • Loading branch information
JamyDev committed Jul 17, 2023
1 parent 516a01f commit 52cc28f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions README.md
Expand Up @@ -17,7 +17,7 @@ The isolated comment blocks like below:

```
import (
"fmt"
"fmt"
// this line is isolated comment
// those lines belong to one
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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"
)
```
Expand Down
2 changes: 1 addition & 1 deletion cmd/gci/gcicommand.go
Expand Up @@ -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"
Expand Down

0 comments on commit 52cc28f

Please sign in to comment.