1
0
mirror of https://github.com/golang/go synced 2024-11-24 23:07:56 -07:00

gofmt: simplify flags

-tabs replaces -tabindent
-spaces has been removed

R=golang-dev, adg, rsc
CC=golang-dev
https://golang.org/cl/5487066
This commit is contained in:
Robert Griesemer 2011-12-13 14:03:25 -08:00
parent 0b0a6ec7ec
commit fe746335aa
2 changed files with 4 additions and 10 deletions

View File

@ -36,10 +36,8 @@ The flags are:
Formatting control flags:
-comments=true
Print comments; if false, all comments are elided from the output.
-spaces
Align with spaces instead of tabs.
-tabindent
Indent with tabs independent of -spaces.
-tabs=true
Indent with tabs; if false, spaces are used instead.
-tabwidth=8
Tab width in spaces.

View File

@ -34,8 +34,7 @@ var (
// layout control
comments = flag.Bool("comments", true, "print comments")
tabWidth = flag.Int("tabwidth", 8, "tab width")
tabIndent = flag.Bool("tabindent", true, "indent with tabs independent of -spaces")
useSpaces = flag.Bool("spaces", true, "align with spaces instead of tabs")
tabIndent = flag.Bool("tabs", true, "indent with tabs")
// debugging
cpuprofile = flag.String("cpuprofile", "", "write cpu profile to this file")
@ -71,13 +70,10 @@ func initParserMode() {
}
func initPrinterMode() {
printerMode = uint(0)
printerMode = printer.UseSpaces
if *tabIndent {
printerMode |= printer.TabIndent
}
if *useSpaces {
printerMode |= printer.UseSpaces
}
}
func isGoFile(f os.FileInfo) bool {