MCPcopy Create free account
hub / github.com/bufbuild/buf / newRootCommand

Function newRootCommand

cmd/buf/buf.go:135–475  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

133}
134
135func newRootCommand(name string) *appcmd.Command {
136 builder := appext.NewBuilder(
137 name,
138 appext.BuilderWithTimeout(0),
139 appext.BuilderWithInterceptor(newErrorInterceptor()),
140 appext.BuilderWithLoggerProvider(slogapp.LoggerProvider),
141 )
142 return &appcmd.Command{
143 Use: name,
144 Short: "The Buf CLI",
145 Long: "A tool for working with Protocol Buffers and managing resources on the Buf Schema Registry (BSR)",
146 Version: bufcli.Version,
147 BindPersistentFlags: builder.BindRoot,
148 SubCommands: []*appcmd.Command{
149 build.NewCommand("build", builder),
150 export.NewCommand("export", builder),
151 format.NewCommand("format", builder),
152 lint.NewCommand("lint", builder),
153 breaking.NewCommand("breaking", builder),
154 generate.NewCommand("generate", builder),
155 lsfiles.NewCommand("ls-files", builder),
156 stats.NewCommand("stats", builder),
157 push.NewCommand("push", builder),
158 convert.NewCommand("convert", builder),
159 curl.NewCommand("curl", builder),
160 {
161 Use: "dep",
162 Short: "Work with dependencies",
163 SubCommands: []*appcmd.Command{
164 depgraph.NewCommand("graph", builder),
165 depprune.NewCommand("prune", builder, ``, false),
166 depupdate.NewCommand("update", builder, ``, false),
167 },
168 },
169 {
170 Use: "config",
171 Short: "Work with configuration files",
172 SubCommands: []*appcmd.Command{
173 configinit.NewCommand("init", builder, ``, false, false),
174 configmigrate.NewCommand("migrate", builder),
175 configlslintrules.NewCommand("ls-lint-rules", builder),
176 configlsbreakingrules.NewCommand("ls-breaking-rules", builder),
177 configlsmodules.NewCommand("ls-modules", builder),
178 },
179 },
180 {
181 Use: "source",
182 Short: "Work with Protobuf source files",
183 SubCommands: []*appcmd.Command{
184 {
185 Use: "edit",
186 Short: "Edit Protobuf source files",
187 SubCommands: []*appcmd.Command{
188 sourceeditdeprecate.NewCommand("deprecate", builder),
189 },
190 },
191 },
192 },

Callers 6

testRunStderrWithCacheFunction · 0.85
mainFunction · 0.85

Calls 15

NewCommandFunction · 0.92
NewCommandFunction · 0.92
NewCommandFunction · 0.92
NewCommandFunction · 0.92
NewCommandFunction · 0.92
NewCommandFunction · 0.92
NewCommandFunction · 0.92
NewCommandFunction · 0.92
NewCommandFunction · 0.92
NewCommandFunction · 0.92
NewCommandFunction · 0.92
NewCommandFunction · 0.92

Used in the wild real call sites across dependent graphs

searching dependent graphs…