@@ -34,7 +34,7 @@ type application struct {
34
34
Deps bool `flag:"deps" help:"show dependencies too"`
35
35
Test bool `flag:"test" help:"include any tests implied by the patterns"`
36
36
Mode string `flag:"mode" help:"mode (one of files, imports, types, syntax, allsyntax)"`
37
- Private bool `flag:"private" help:"show non-exported declarations too"`
37
+ Private bool `flag:"private" help:"show non-exported declarations too (if -mode=syntax) "`
38
38
PrintJSON bool `flag:"json" help:"print package in JSON form"`
39
39
BuildFlags stringListValue `flag:"buildflag" help:"pass argument to underlying build system (may be repeated)"`
40
40
}
@@ -56,6 +56,21 @@ func (app *application) DetailedHelp(f *flag.FlagSet) {
56
56
Packages are specified using the notation of "go list",
57
57
or other underlying build system.
58
58
59
+ The mode flag determines how much information is computed and printed
60
+ for the specified packages. In order of increasing computational cost,
61
+ the legal values are:
62
+
63
+ -mode=files shows only the names of the packages' files.
64
+ -mode=imports also shows the imports. (This is the default.)
65
+ -mode=types loads the compiler's export data and displays the
66
+ type of each exported declaration.
67
+ -mode=syntax parses and type checks syntax trees for the initial
68
+ packages. (With the -private flag, the types of
69
+ non-exported declarations are shown too.)
70
+ Type information for dependencies is obtained from
71
+ compiler export data.
72
+ -mode=allsyntax is like -mode=syntax but applied to all dependencies.
73
+
59
74
Flags:
60
75
` )
61
76
f .PrintDefaults ()
@@ -189,7 +204,7 @@ func (app *application) print(lpkg *packages.Package) {
189
204
fmt .Printf ("\t %s\n " , err )
190
205
}
191
206
192
- // package members (TypeCheck or WholeProgram mode)
207
+ // types of package members
193
208
if lpkg .Types != nil {
194
209
qual := types .RelativeTo (lpkg .Types )
195
210
scope := lpkg .Types .Scope ()
0 commit comments