|
43 | 43 | filterFlag = flag.String("filter", "<module>", "report only packages matching this regular expression (default: module of first package)")
|
44 | 44 | generatedFlag = flag.Bool("generated", false, "include dead functions in generated Go files")
|
45 | 45 | whyLiveFlag = flag.String("whylive", "", "show a path from main to the named function")
|
46 |
| - formatFlag = flag.String("format", "", "format output records using template") |
| 46 | + formatFlag = flag.String("f", "", "format output records using template") |
47 | 47 | jsonFlag = flag.Bool("json", false, "output JSON records")
|
48 | 48 | cpuProfile = flag.String("cpuprofile", "", "write CPU profile to this file")
|
49 | 49 | memProfile = flag.String("memprofile", "", "write memory profile to this file")
|
@@ -101,10 +101,10 @@ func main() {
|
101 | 101 | // Reject bad output options early.
|
102 | 102 | if *formatFlag != "" {
|
103 | 103 | if *jsonFlag {
|
104 |
| - log.Fatalf("you cannot specify both -format=template and -json") |
| 104 | + log.Fatalf("you cannot specify both -f=template and -json") |
105 | 105 | }
|
106 | 106 | if _, err := template.New("deadcode").Parse(*formatFlag); err != nil {
|
107 |
| - log.Fatalf("invalid -format: %v", err) |
| 107 | + log.Fatalf("invalid -f: %v", err) |
108 | 108 | }
|
109 | 109 | }
|
110 | 110 |
|
@@ -232,7 +232,7 @@ func main() {
|
232 | 232 | }
|
233 | 233 |
|
234 | 234 | // Build a list of jsonEdge records
|
235 |
| - // to print as -json or -format=template. |
| 235 | + // to print as -json or -f=template. |
236 | 236 | var edges []any
|
237 | 237 | for _, edge := range path {
|
238 | 238 | edges = append(edges, jsonEdge{
|
@@ -357,7 +357,7 @@ func printObjects(format string, objects []any) {
|
357 | 357 | return
|
358 | 358 | }
|
359 | 359 |
|
360 |
| - // -format=template. Parse can't fail: we checked it earlier. |
| 360 | + // -f=template. Parse can't fail: we checked it earlier. |
361 | 361 | tmpl := template.Must(template.New("deadcode").Parse(format))
|
362 | 362 | for _, object := range objects {
|
363 | 363 | var buf bytes.Buffer
|
|
0 commit comments