// Run takes the args after top level flag processing, and invokes the correct
// sub command as specified by the first argument.
// If no arguments are passed it will invoke the server sub command, as a
// temporary measure for compatibility.
Run takes the args after top level flag processing, and invokes the correct
sub command as specified by the first argument.
If no arguments are passed it will invoke the server sub command, as a
temporary measure for compatibility.
// Run takes the args after top level flag processing and invokes the correct // sub command as specified by the first argument . // If no arguments are passed it will invoke the server sub command as a // temporary measure for compatibility .
func (app *Application) Run(ctx context.Context, args ...string) error {
	if len(args) == 0 {
		tool.Main(ctx, &app.Server, args)
		return nil
	}
	mode, args := args[0], args[1:]
	for _, m := range app.modes() {
		if m.Name() == mode {
			tool.Main(ctx, m, args)
			return nil
		}
	}
	return tool.CommandLineErrorf("Unknown mode %v", mode)
}
func ( app * Application ) Run ( ctx context . Context , args ... string ) error { if len ( args ) == 0 { tool . Main ( ctx , & app . Server , args ) return nil } mode , args := args [ 0 ] , args [ 1 : ] for _ , m := range app . modes ( ) { if m . Name ( ) == mode { tool . Main ( ctx , m , args ) return nil } } return tool . CommandLineErrorf ( " " , mode ) }
Run takes the args after top level flag processing, and invokes the correct
sub command as specified by the first argument.
Run takes the args after top level flag processing and invokes the correct sub command as specified by the first argument .