diff options
author | Robert Griesemer <gri@golang.org> | 2011-12-13 14:03:25 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2011-12-13 14:03:25 -0800 |
commit | 96a73a463fcbbdf5afd332dea7868210f220403b (patch) | |
tree | 0ea68811cd8c35e3d5eb96e4dd8e0da79215b86e /src/cmd/gofmt | |
parent | 29ef975ca3802b84de7a7f9ca97309d865c7e579 (diff) | |
download | go-96a73a463fcbbdf5afd332dea7868210f220403b.tar.gz |
gofmt: simplify flags
-tabs replaces -tabindent
-spaces has been removed
R=golang-dev, adg, rsc
CC=golang-dev
http://codereview.appspot.com/5487066
Diffstat (limited to 'src/cmd/gofmt')
-rw-r--r-- | src/cmd/gofmt/doc.go | 6 | ||||
-rw-r--r-- | src/cmd/gofmt/gofmt.go | 8 |
2 files changed, 4 insertions, 10 deletions
diff --git a/src/cmd/gofmt/doc.go b/src/cmd/gofmt/doc.go index 3a20c21e0..65842a3b1 100644 --- a/src/cmd/gofmt/doc.go +++ b/src/cmd/gofmt/doc.go @@ -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. diff --git a/src/cmd/gofmt/gofmt.go b/src/cmd/gofmt/gofmt.go index b9042271a..0023e2f21 100644 --- a/src/cmd/gofmt/gofmt.go +++ b/src/cmd/gofmt/gofmt.go @@ -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 { |