Commit fe746335 authored by Robert Griesemer's avatar Robert Griesemer

gofmt: simplify flags

-tabs replaces -tabindent
-spaces has been removed

R=golang-dev, adg, rsc
CC=golang-dev
https://golang.org/cl/5487066
parent 0b0a6ec7
...@@ -36,10 +36,8 @@ The flags are: ...@@ -36,10 +36,8 @@ The flags are:
Formatting control flags: Formatting control flags:
-comments=true -comments=true
Print comments; if false, all comments are elided from the output. Print comments; if false, all comments are elided from the output.
-spaces -tabs=true
Align with spaces instead of tabs. Indent with tabs; if false, spaces are used instead.
-tabindent
Indent with tabs independent of -spaces.
-tabwidth=8 -tabwidth=8
Tab width in spaces. Tab width in spaces.
......
...@@ -34,8 +34,7 @@ var ( ...@@ -34,8 +34,7 @@ var (
// layout control // layout control
comments = flag.Bool("comments", true, "print comments") comments = flag.Bool("comments", true, "print comments")
tabWidth = flag.Int("tabwidth", 8, "tab width") tabWidth = flag.Int("tabwidth", 8, "tab width")
tabIndent = flag.Bool("tabindent", true, "indent with tabs independent of -spaces") tabIndent = flag.Bool("tabs", true, "indent with tabs")
useSpaces = flag.Bool("spaces", true, "align with spaces instead of tabs")
// debugging // debugging
cpuprofile = flag.String("cpuprofile", "", "write cpu profile to this file") cpuprofile = flag.String("cpuprofile", "", "write cpu profile to this file")
...@@ -71,13 +70,10 @@ func initParserMode() { ...@@ -71,13 +70,10 @@ func initParserMode() {
} }
func initPrinterMode() { func initPrinterMode() {
printerMode = uint(0) printerMode = printer.UseSpaces
if *tabIndent { if *tabIndent {
printerMode |= printer.TabIndent printerMode |= printer.TabIndent
} }
if *useSpaces {
printerMode |= printer.UseSpaces
}
} }
func isGoFile(f os.FileInfo) bool { func isGoFile(f os.FileInfo) bool {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment