]> Cypherpunks repositories - gostls13.git/commitdiff
gofmt: remove -trace and -ast flags
authorRobert Griesemer <gri@golang.org>
Thu, 10 Mar 2011 20:54:18 +0000 (12:54 -0800)
committerRobert Griesemer <gri@golang.org>
Thu, 10 Mar 2011 20:54:18 +0000 (12:54 -0800)
Functionality was only present for
debuggging and now is available in
gocheck where is makes more sense.

R=rsc
CC=golang-dev
https://golang.org/cl/4239078

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

index 2d2c9ae6118fcc1dd922bbb3e0245b1256cdbbc1..e44030eee92dcee2723cb0e04d81cf3379687635 100644 (file)
@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 /*
-
 Gofmt formats Go programs.
 
 Without an explicit path, it processes the standard input.  Given a file,
@@ -16,14 +15,16 @@ Usage:
 The flags are:
 
        -l
-               just list files whose formatting differs from gofmt's; generate no other output
-               unless -w is also set.
+               just list files whose formatting differs from gofmt's;
+               generate no other output unless -w is also set.
        -r rule
                apply the rewrite rule to the source before reformatting.
        -s
                try to simplify code (after applying the rewrite rule, if any).
        -w
                if set, overwrite each input file with its output.
+       -comments=true
+               print comments; if false, all comments are elided from the output.
        -spaces
                align with spaces instead of tabs.
        -tabindent
@@ -31,15 +32,6 @@ The flags are:
        -tabwidth=8
                tab width in spaces.
 
-Debugging flags:
-
-       -trace
-               print parse trace.
-       -ast
-               print AST (before rewrites).
-       -comments=true
-               print comments; if false, all comments are elided from the output.
-
 The rewrite rule specified with the -r flag must be a string of the form:
 
        pattern -> replacement
index 224aee717d61f99023b4346514738f314b7c4999..0262875413291914c47d4e1839c7dd293e02cc4d 100644 (file)
@@ -27,12 +27,8 @@ var (
        rewriteRule = flag.String("r", "", "rewrite rule (e.g., 'α[β:len(α)] -> α[β:]')")
        simplifyAST = flag.Bool("s", false, "simplify code")
 
-       // debugging support
-       comments = flag.Bool("comments", true, "print comments")
-       trace    = flag.Bool("trace", false, "print parse trace")
-       printAST = flag.Bool("ast", false, "print AST (before rewrites)")
-
        // 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")
@@ -66,9 +62,6 @@ func initParserMode() {
        if *comments {
                parserMode |= parser.ParseComments
        }
-       if *trace {
-               parserMode |= parser.Trace
-       }
 }
 
 
@@ -101,10 +94,6 @@ func processFile(f *os.File) os.Error {
                return err
        }
 
-       if *printAST {
-               ast.Print(file)
-       }
-
        if rewrite != nil {
                file = rewrite(file)
        }