summaryrefslogtreecommitdiff
path: root/src/cmd/gofmt/doc.go
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-04-28 10:35:15 +0200
committerOndřej Surý <ondrej@sury.org>2011-04-28 10:35:15 +0200
commitc1ba1a0fec4aed430709030f98a3bdb90bfeea16 (patch)
tree3df18657e50a0313ed6defcda30e4474cb28a467 /src/cmd/gofmt/doc.go
parent7b15ed9ef455b6b66c6b376898a88aef5d6a9970 (diff)
downloadgolang-c1ba1a0fec4aed430709030f98a3bdb90bfeea16.tar.gz
Imported Upstream version 2011.04.27upstream/2011.04.27
Diffstat (limited to 'src/cmd/gofmt/doc.go')
-rw-r--r--src/cmd/gofmt/doc.go26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/cmd/gofmt/doc.go b/src/cmd/gofmt/doc.go
index e44030eee..1373b2657 100644
--- a/src/cmd/gofmt/doc.go
+++ b/src/cmd/gofmt/doc.go
@@ -8,29 +8,37 @@ Gofmt formats Go programs.
Without an explicit path, it processes the standard input. Given a file,
it operates on that file; given a directory, it operates on all .go files in
that directory, recursively. (Files starting with a period are ignored.)
+By default, gofmt prints the reformatted sources to standard output.
Usage:
gofmt [flags] [path ...]
The flags are:
+ -d
+ Do not print reformatted sources to standard output.
+ If a file's formatting is different than gofmt's, print diffs
+ to standard output.
-l
- just list files whose formatting differs from gofmt's;
- generate no other output unless -w is also set.
+ Do not print reformatted sources to standard output.
+ If a file's formatting is different from gofmt's, print its name
+ to standard output.
-r rule
- apply the rewrite rule to the source before reformatting.
+ Apply the rewrite rule to the source before reformatting.
-s
- try to simplify code (after applying the rewrite rule, if any).
+ Try to simplify code (after applying the rewrite rule, if any).
-w
- if set, overwrite each input file with its output.
+ Do not print reformatted sources to standard output.
+ If a file's formatting is different from gofmt's, overwrite it
+ with gofmt's version.
-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
- align with spaces instead of tabs.
+ Align with spaces instead of tabs.
-tabindent
- indent with tabs independent of -spaces.
+ Indent with tabs independent of -spaces.
-tabwidth=8
- tab width in spaces.
+ Tab width in spaces.
The rewrite rule specified with the -r flag must be a string of the form: