]> Cypherpunks repositories - gostls13.git/commitdiff
gofmt: simplify flags
authorRobert Griesemer <gri@golang.org>
Tue, 13 Dec 2011 22:03:25 +0000 (14:03 -0800)
committerRobert Griesemer <gri@golang.org>
Tue, 13 Dec 2011 22:03:25 +0000 (14:03 -0800)
-tabs replaces -tabindent
-spaces has been removed

R=golang-dev, adg, rsc
CC=golang-dev
https://golang.org/cl/5487066

src/cmd/gofmt/doc.go
src/cmd/gofmt/gofmt.go

index 3a20c21e0ef656114a704787e4fe9bf57ec53db7..65842a3b15bb81d7f5883dd5b0e98d991efe16a8 100644 (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.
 
index b9042271ab9310e424b541b9f5f49a2f8a73c23f..0023e2f218a75a507f4f9268cffa3f072b92ab22 100644 (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 {