How to use command class

Best Atoum code snippet using command

ArtisanServiceProvider.php

Source:ArtisanServiceProvider.php Github

copy

Full Screen

...75use Illuminate\Database\Console\Migrations\RollbackCommand as MigrateRollbackCommand;76class ArtisanServiceProvider extends ServiceProvider implements DeferrableProvider77{78 /**79 * The commands to be registered.80 *81 * @var array82 */83 protected $commands = [84 'CacheClear' => 'command.cache.clear',85 'CacheForget' => 'command.cache.forget',86 'ClearCompiled' => 'command.clear-compiled',87 'ClearResets' => 'command.auth.resets.clear',88 'ConfigCache' => 'command.config.cache',89 'ConfigClear' => 'command.config.clear',90 'Down' => 'command.down',91 'Environment' => 'command.environment',92 'EventCache' => 'command.event.cache',93 'EventClear' => 'command.event.clear',94 'EventList' => 'command.event.list',95 'KeyGenerate' => 'command.key.generate',96 'Migrate' => 'command.migrate',97 'MigrateFresh' => 'command.migrate.fresh',98 'MigrateInstall' => 'command.migrate.install',99 'MigrateRefresh' => 'command.migrate.refresh',100 'MigrateReset' => 'command.migrate.reset',101 'MigrateRollback' => 'command.migrate.rollback',102 'MigrateStatus' => 'command.migrate.status',103 'Optimize' => 'command.optimize',104 'OptimizeClear' => 'command.optimize.clear',105 'PackageDiscover' => 'command.package.discover',106 'Preset' => 'command.preset',107 'QueueFailed' => 'command.queue.failed',108 'QueueFlush' => 'command.queue.flush',109 'QueueForget' => 'command.queue.forget',110 'QueueListen' => 'command.queue.listen',111 'QueueRestart' => 'command.queue.restart',112 'QueueRetry' => 'command.queue.retry',113 'QueueWork' => 'command.queue.work',114 'RouteCache' => 'command.route.cache',115 'RouteClear' => 'command.route.clear',116 'RouteList' => 'command.route.list',117 'Seed' => 'command.seed',118 'ScheduleFinish' => ScheduleFinishCommand::class,119 'ScheduleRun' => ScheduleRunCommand::class,120 'StorageLink' => 'command.storage.link',121 'Up' => 'command.up',122 'ViewCache' => 'command.view.cache',123 'ViewClear' => 'command.view.clear',124 ];125 /**126 * The commands to be registered.127 *128 * @var array129 */130 protected $devCommands = [131 'AppName' => 'command.app.name',132 'AuthMake' => 'command.auth.make',133 'CacheTable' => 'command.cache.table',134 'ChannelMake' => 'command.channel.make',135 'ConsoleMake' => 'command.console.make',136 'ControllerMake' => 'command.controller.make',137 'EventGenerate' => 'command.event.generate',138 'EventMake' => 'command.event.make',139 'ExceptionMake' => 'command.exception.make',140 'FactoryMake' => 'command.factory.make',141 'JobMake' => 'command.job.make',142 'ListenerMake' => 'command.listener.make',143 'MailMake' => 'command.mail.make',144 'MiddlewareMake' => 'command.middleware.make',145 'MigrateMake' => 'command.migrate.make',146 'ModelMake' => 'command.model.make',147 'NotificationMake' => 'command.notification.make',148 'NotificationTable' => 'command.notification.table',149 'ObserverMake' => 'command.observer.make',150 'PolicyMake' => 'command.policy.make',151 'ProviderMake' => 'command.provider.make',152 'QueueFailedTable' => 'command.queue.failed-table',153 'QueueTable' => 'command.queue.table',154 'RequestMake' => 'command.request.make',155 'ResourceMake' => 'command.resource.make',156 'RuleMake' => 'command.rule.make',157 'SeederMake' => 'command.seeder.make',158 'SessionTable' => 'command.session.table',159 'Serve' => 'command.serve',160 'TestMake' => 'command.test.make',161 'VendorPublish' => 'command.vendor.publish',162 ];163 /**164 * Register the service provider.165 *166 * @return void167 */168 public function register()169 {170 $this->registerCommands(array_merge(171 $this->commands, $this->devCommands172 ));173 }174 /**175 * Register the given commands.176 *177 * @param array $commands178 * @return void179 */180 protected function registerCommands(array $commands)181 {182 foreach (array_keys($commands) as $command) {183 call_user_func_array([$this, "register{$command}Command"], []);184 }185 $this->commands(array_values($commands));186 }187 /**188 * Register the command.189 *190 * @return void191 */192 protected function registerAppNameCommand()193 {194 $this->app->singleton('command.app.name', function ($app) {195 return new AppNameCommand($app['composer'], $app['files']);196 });197 }198 /**199 * Register the command.200 *201 * @return void202 */203 protected function registerAuthMakeCommand()204 {205 $this->app->singleton('command.auth.make', function () {206 return new AuthMakeCommand;207 });208 }209 /**210 * Register the command.211 *212 * @return void213 */214 protected function registerCacheClearCommand()215 {216 $this->app->singleton('command.cache.clear', function ($app) {217 return new CacheClearCommand($app['cache'], $app['files']);218 });219 }220 /**221 * Register the command.222 *223 * @return void224 */225 protected function registerCacheForgetCommand()226 {227 $this->app->singleton('command.cache.forget', function ($app) {228 return new CacheForgetCommand($app['cache']);229 });230 }231 /**232 * Register the command.233 *234 * @return void235 */236 protected function registerCacheTableCommand()237 {238 $this->app->singleton('command.cache.table', function ($app) {239 return new CacheTableCommand($app['files'], $app['composer']);240 });241 }242 /**243 * Register the command.244 *245 * @return void246 */247 protected function registerChannelMakeCommand()248 {249 $this->app->singleton('command.channel.make', function ($app) {250 return new ChannelMakeCommand($app['files']);251 });252 }253 /**254 * Register the command.255 *256 * @return void257 */258 protected function registerClearCompiledCommand()259 {260 $this->app->singleton('command.clear-compiled', function () {261 return new ClearCompiledCommand;262 });263 }264 /**265 * Register the command.266 *267 * @return void268 */269 protected function registerClearResetsCommand()270 {271 $this->app->singleton('command.auth.resets.clear', function () {272 return new ClearResetsCommand;273 });274 }275 /**276 * Register the command.277 *278 * @return void279 */280 protected function registerConfigCacheCommand()281 {282 $this->app->singleton('command.config.cache', function ($app) {283 return new ConfigCacheCommand($app['files']);284 });285 }286 /**287 * Register the command.288 *289 * @return void290 */291 protected function registerConfigClearCommand()292 {293 $this->app->singleton('command.config.clear', function ($app) {294 return new ConfigClearCommand($app['files']);295 });296 }297 /**298 * Register the command.299 *300 * @return void301 */302 protected function registerConsoleMakeCommand()303 {304 $this->app->singleton('command.console.make', function ($app) {305 return new ConsoleMakeCommand($app['files']);306 });307 }308 /**309 * Register the command.310 *311 * @return void312 */313 protected function registerControllerMakeCommand()314 {315 $this->app->singleton('command.controller.make', function ($app) {316 return new ControllerMakeCommand($app['files']);317 });318 }319 /**320 * Register the command.321 *322 * @return void323 */324 protected function registerEventGenerateCommand()325 {326 $this->app->singleton('command.event.generate', function () {327 return new EventGenerateCommand;328 });329 }330 /**331 * Register the command.332 *333 * @return void334 */335 protected function registerEventMakeCommand()336 {337 $this->app->singleton('command.event.make', function ($app) {338 return new EventMakeCommand($app['files']);339 });340 }341 /**342 * Register the command.343 *344 * @return void345 */346 protected function registerExceptionMakeCommand()347 {348 $this->app->singleton('command.exception.make', function ($app) {349 return new ExceptionMakeCommand($app['files']);350 });351 }352 /**353 * Register the command.354 *355 * @return void356 */357 protected function registerFactoryMakeCommand()358 {359 $this->app->singleton('command.factory.make', function ($app) {360 return new FactoryMakeCommand($app['files']);361 });362 }363 /**364 * Register the command.365 *366 * @return void367 */368 protected function registerDownCommand()369 {370 $this->app->singleton('command.down', function () {371 return new DownCommand;372 });373 }374 /**375 * Register the command.376 *377 * @return void378 */379 protected function registerEnvironmentCommand()380 {381 $this->app->singleton('command.environment', function () {382 return new EnvironmentCommand;383 });384 }385 /**386 * Register the command.387 *388 * @return void389 */390 protected function registerEventCacheCommand()391 {392 $this->app->singleton('command.event.cache', function () {393 return new EventCacheCommand;394 });395 }396 /**397 * Register the command.398 *399 * @return void400 */401 protected function registerEventClearCommand()402 {403 $this->app->singleton('command.event.clear', function ($app) {404 return new EventClearCommand($app['files']);405 });406 }407 /**408 * Register the command.409 *410 * @return void411 */412 protected function registerEventListCommand()413 {414 $this->app->singleton('command.event.list', function () {415 return new EventListCommand();416 });417 }418 /**419 * Register the command.420 *421 * @return void422 */423 protected function registerJobMakeCommand()424 {425 $this->app->singleton('command.job.make', function ($app) {426 return new JobMakeCommand($app['files']);427 });428 }429 /**430 * Register the command.431 *432 * @return void433 */434 protected function registerKeyGenerateCommand()435 {436 $this->app->singleton('command.key.generate', function () {437 return new KeyGenerateCommand;438 });439 }440 /**441 * Register the command.442 *443 * @return void444 */445 protected function registerListenerMakeCommand()446 {447 $this->app->singleton('command.listener.make', function ($app) {448 return new ListenerMakeCommand($app['files']);449 });450 }451 /**452 * Register the command.453 *454 * @return void455 */456 protected function registerMailMakeCommand()457 {458 $this->app->singleton('command.mail.make', function ($app) {459 return new MailMakeCommand($app['files']);460 });461 }462 /**463 * Register the command.464 *465 * @return void466 */467 protected function registerMiddlewareMakeCommand()468 {469 $this->app->singleton('command.middleware.make', function ($app) {470 return new MiddlewareMakeCommand($app['files']);471 });472 }473 /**474 * Register the command.475 *476 * @return void477 */478 protected function registerMigrateCommand()479 {480 $this->app->singleton('command.migrate', function ($app) {481 return new MigrateCommand($app['migrator']);482 });483 }484 /**485 * Register the command.486 *487 * @return void488 */489 protected function registerMigrateFreshCommand()490 {491 $this->app->singleton('command.migrate.fresh', function () {492 return new MigrateFreshCommand;493 });494 }495 /**496 * Register the command.497 *498 * @return void499 */500 protected function registerMigrateInstallCommand()501 {502 $this->app->singleton('command.migrate.install', function ($app) {503 return new MigrateInstallCommand($app['migration.repository']);504 });505 }506 /**507 * Register the command.508 *509 * @return void510 */511 protected function registerMigrateMakeCommand()512 {513 $this->app->singleton('command.migrate.make', function ($app) {514 // Once we have the migration creator registered, we will create the command515 // and inject the creator. The creator is responsible for the actual file516 // creation of the migrations, and may be extended by these developers.517 $creator = $app['migration.creator'];518 $composer = $app['composer'];519 return new MigrateMakeCommand($creator, $composer);520 });521 }522 /**523 * Register the command.524 *525 * @return void526 */527 protected function registerMigrateRefreshCommand()528 {529 $this->app->singleton('command.migrate.refresh', function () {530 return new MigrateRefreshCommand;531 });532 }533 /**534 * Register the command.535 *536 * @return void537 */538 protected function registerMigrateResetCommand()539 {540 $this->app->singleton('command.migrate.reset', function ($app) {541 return new MigrateResetCommand($app['migrator']);542 });543 }544 /**545 * Register the command.546 *547 * @return void548 */549 protected function registerMigrateRollbackCommand()550 {551 $this->app->singleton('command.migrate.rollback', function ($app) {552 return new MigrateRollbackCommand($app['migrator']);553 });554 }555 /**556 * Register the command.557 *558 * @return void559 */560 protected function registerMigrateStatusCommand()561 {562 $this->app->singleton('command.migrate.status', function ($app) {563 return new MigrateStatusCommand($app['migrator']);564 });565 }566 /**567 * Register the command.568 *569 * @return void570 */571 protected function registerModelMakeCommand()572 {573 $this->app->singleton('command.model.make', function ($app) {574 return new ModelMakeCommand($app['files']);575 });576 }577 /**578 * Register the command.579 *580 * @return void581 */582 protected function registerNotificationMakeCommand()583 {584 $this->app->singleton('command.notification.make', function ($app) {585 return new NotificationMakeCommand($app['files']);586 });587 }588 /**589 * Register the command.590 *591 * @return void592 */593 protected function registerNotificationTableCommand()594 {595 $this->app->singleton('command.notification.table', function ($app) {596 return new NotificationTableCommand($app['files'], $app['composer']);597 });598 }599 /**600 * Register the command.601 *602 * @return void603 */604 protected function registerOptimizeCommand()605 {606 $this->app->singleton('command.optimize', function () {607 return new OptimizeCommand;608 });609 }610 /**611 * Register the command.612 *613 * @return void614 */615 protected function registerObserverMakeCommand()616 {617 $this->app->singleton('command.observer.make', function ($app) {618 return new ObserverMakeCommand($app['files']);619 });620 }621 /**622 * Register the command.623 *624 * @return void625 */626 protected function registerOptimizeClearCommand()627 {628 $this->app->singleton('command.optimize.clear', function () {629 return new OptimizeClearCommand;630 });631 }632 /**633 * Register the command.634 *635 * @return void636 */637 protected function registerPackageDiscoverCommand()638 {639 $this->app->singleton('command.package.discover', function () {640 return new PackageDiscoverCommand;641 });642 }643 /**644 * Register the command.645 *646 * @return void647 */648 protected function registerPolicyMakeCommand()649 {650 $this->app->singleton('command.policy.make', function ($app) {651 return new PolicyMakeCommand($app['files']);652 });653 }654 /**655 * Register the command.656 *657 * @return void658 */659 protected function registerPresetCommand()660 {661 $this->app->singleton('command.preset', function () {662 return new PresetCommand;663 });664 }665 /**666 * Register the command.667 *668 * @return void669 */670 protected function registerProviderMakeCommand()671 {672 $this->app->singleton('command.provider.make', function ($app) {673 return new ProviderMakeCommand($app['files']);674 });675 }676 /**677 * Register the command.678 *679 * @return void680 */681 protected function registerQueueFailedCommand()682 {683 $this->app->singleton('command.queue.failed', function () {684 return new ListFailedQueueCommand;685 });686 }687 /**688 * Register the command.689 *690 * @return void691 */692 protected function registerQueueForgetCommand()693 {694 $this->app->singleton('command.queue.forget', function () {695 return new ForgetFailedQueueCommand;696 });697 }698 /**699 * Register the command.700 *701 * @return void702 */703 protected function registerQueueFlushCommand()704 {705 $this->app->singleton('command.queue.flush', function () {706 return new FlushFailedQueueCommand;707 });708 }709 /**710 * Register the command.711 *712 * @return void713 */714 protected function registerQueueListenCommand()715 {716 $this->app->singleton('command.queue.listen', function ($app) {717 return new QueueListenCommand($app['queue.listener']);718 });719 }720 /**721 * Register the command.722 *723 * @return void724 */725 protected function registerQueueRestartCommand()726 {727 $this->app->singleton('command.queue.restart', function () {728 return new QueueRestartCommand;729 });730 }731 /**732 * Register the command.733 *734 * @return void735 */736 protected function registerQueueRetryCommand()737 {738 $this->app->singleton('command.queue.retry', function () {739 return new QueueRetryCommand;740 });741 }742 /**743 * Register the command.744 *745 * @return void746 */747 protected function registerQueueWorkCommand()748 {749 $this->app->singleton('command.queue.work', function ($app) {750 return new QueueWorkCommand($app['queue.worker']);751 });752 }753 /**754 * Register the command.755 *756 * @return void757 */758 protected function registerQueueFailedTableCommand()759 {760 $this->app->singleton('command.queue.failed-table', function ($app) {761 return new FailedTableCommand($app['files'], $app['composer']);762 });763 }764 /**765 * Register the command.766 *767 * @return void768 */769 protected function registerQueueTableCommand()770 {771 $this->app->singleton('command.queue.table', function ($app) {772 return new TableCommand($app['files'], $app['composer']);773 });774 }775 /**776 * Register the command.777 *778 * @return void779 */780 protected function registerRequestMakeCommand()781 {782 $this->app->singleton('command.request.make', function ($app) {783 return new RequestMakeCommand($app['files']);784 });785 }786 /**787 * Register the command.788 *789 * @return void790 */791 protected function registerResourceMakeCommand()792 {793 $this->app->singleton('command.resource.make', function ($app) {794 return new ResourceMakeCommand($app['files']);795 });796 }797 /**798 * Register the command.799 *800 * @return void801 */802 protected function registerRuleMakeCommand()803 {804 $this->app->singleton('command.rule.make', function ($app) {805 return new RuleMakeCommand($app['files']);806 });807 }808 /**809 * Register the command.810 *811 * @return void812 */813 protected function registerSeederMakeCommand()814 {815 $this->app->singleton('command.seeder.make', function ($app) {816 return new SeederMakeCommand($app['files'], $app['composer']);817 });818 }819 /**820 * Register the command.821 *822 * @return void823 */824 protected function registerSessionTableCommand()825 {826 $this->app->singleton('command.session.table', function ($app) {827 return new SessionTableCommand($app['files'], $app['composer']);828 });829 }830 /**831 * Register the command.832 *833 * @return void834 */835 protected function registerStorageLinkCommand()836 {837 $this->app->singleton('command.storage.link', function () {838 return new StorageLinkCommand;839 });840 }841 /**842 * Register the command.843 *844 * @return void845 */846 protected function registerRouteCacheCommand()847 {848 $this->app->singleton('command.route.cache', function ($app) {849 return new RouteCacheCommand($app['files']);850 });851 }852 /**853 * Register the command.854 *855 * @return void856 */857 protected function registerRouteClearCommand()858 {859 $this->app->singleton('command.route.clear', function ($app) {860 return new RouteClearCommand($app['files']);861 });862 }863 /**864 * Register the command.865 *866 * @return void867 */868 protected function registerRouteListCommand()869 {870 $this->app->singleton('command.route.list', function ($app) {871 return new RouteListCommand($app['router']);872 });873 }874 /**875 * Register the command.876 *877 * @return void878 */879 protected function registerSeedCommand()880 {881 $this->app->singleton('command.seed', function ($app) {882 return new SeedCommand($app['db']);883 });884 }885 /**886 * Register the command.887 *888 * @return void889 */890 protected function registerScheduleFinishCommand()891 {892 $this->app->singleton(ScheduleFinishCommand::class);893 }894 /**895 * Register the command.896 *897 * @return void898 */899 protected function registerScheduleRunCommand()900 {901 $this->app->singleton(ScheduleRunCommand::class);902 }903 /**904 * Register the command.905 *906 * @return void907 */908 protected function registerServeCommand()909 {910 $this->app->singleton('command.serve', function () {911 return new ServeCommand;912 });913 }914 /**915 * Register the command.916 *917 * @return void918 */919 protected function registerTestMakeCommand()920 {921 $this->app->singleton('command.test.make', function ($app) {922 return new TestMakeCommand($app['files']);923 });924 }925 /**926 * Register the command.927 *928 * @return void929 */930 protected function registerUpCommand()931 {932 $this->app->singleton('command.up', function () {933 return new UpCommand;934 });935 }936 /**937 * Register the command.938 *939 * @return void940 */941 protected function registerVendorPublishCommand()942 {943 $this->app->singleton('command.vendor.publish', function ($app) {944 return new VendorPublishCommand($app['files']);945 });946 }947 /**948 * Register the command.949 *950 * @return void951 */952 protected function registerViewCacheCommand()953 {954 $this->app->singleton('command.view.cache', function () {955 return new ViewCacheCommand;956 });957 }958 /**959 * Register the command.960 *961 * @return void962 */963 protected function registerViewClearCommand()964 {965 $this->app->singleton('command.view.clear', function ($app) {966 return new ViewClearCommand($app['files']);967 });968 }969 /**970 * Get the services provided by the provider.971 *972 * @return array973 */974 public function provides()975 {976 return array_merge(array_values($this->commands), array_values($this->devCommands));977 }978}...

Full Screen

Full Screen

commands_oss.go

Source:commands_oss.go Github

copy

Full Screen

1package command2import (3 "github.com/hashicorp/consul/command/acl"4 aclagent "github.com/hashicorp/consul/command/acl/agenttokens"5 aclam "github.com/hashicorp/consul/command/acl/authmethod"6 aclamcreate "github.com/hashicorp/consul/command/acl/authmethod/create"7 aclamdelete "github.com/hashicorp/consul/command/acl/authmethod/delete"8 aclamlist "github.com/hashicorp/consul/command/acl/authmethod/list"9 aclamread "github.com/hashicorp/consul/command/acl/authmethod/read"10 aclamupdate "github.com/hashicorp/consul/command/acl/authmethod/update"11 aclbr "github.com/hashicorp/consul/command/acl/bindingrule"12 aclbrcreate "github.com/hashicorp/consul/command/acl/bindingrule/create"13 aclbrdelete "github.com/hashicorp/consul/command/acl/bindingrule/delete"14 aclbrlist "github.com/hashicorp/consul/command/acl/bindingrule/list"15 aclbrread "github.com/hashicorp/consul/command/acl/bindingrule/read"16 aclbrupdate "github.com/hashicorp/consul/command/acl/bindingrule/update"17 aclbootstrap "github.com/hashicorp/consul/command/acl/bootstrap"18 aclpolicy "github.com/hashicorp/consul/command/acl/policy"19 aclpcreate "github.com/hashicorp/consul/command/acl/policy/create"20 aclpdelete "github.com/hashicorp/consul/command/acl/policy/delete"21 aclplist "github.com/hashicorp/consul/command/acl/policy/list"22 aclpread "github.com/hashicorp/consul/command/acl/policy/read"23 aclpupdate "github.com/hashicorp/consul/command/acl/policy/update"24 aclrole "github.com/hashicorp/consul/command/acl/role"25 aclrcreate "github.com/hashicorp/consul/command/acl/role/create"26 aclrdelete "github.com/hashicorp/consul/command/acl/role/delete"27 aclrlist "github.com/hashicorp/consul/command/acl/role/list"28 aclrread "github.com/hashicorp/consul/command/acl/role/read"29 aclrupdate "github.com/hashicorp/consul/command/acl/role/update"30 aclrules "github.com/hashicorp/consul/command/acl/rules"31 acltoken "github.com/hashicorp/consul/command/acl/token"32 acltclone "github.com/hashicorp/consul/command/acl/token/clone"33 acltcreate "github.com/hashicorp/consul/command/acl/token/create"34 acltdelete "github.com/hashicorp/consul/command/acl/token/delete"35 acltlist "github.com/hashicorp/consul/command/acl/token/list"36 acltread "github.com/hashicorp/consul/command/acl/token/read"37 acltupdate "github.com/hashicorp/consul/command/acl/token/update"38 "github.com/hashicorp/consul/command/agent"39 "github.com/hashicorp/consul/command/catalog"40 catlistdc "github.com/hashicorp/consul/command/catalog/list/dc"41 catlistnodes "github.com/hashicorp/consul/command/catalog/list/nodes"42 catlistsvc "github.com/hashicorp/consul/command/catalog/list/services"43 "github.com/hashicorp/consul/command/config"44 configdelete "github.com/hashicorp/consul/command/config/delete"45 configlist "github.com/hashicorp/consul/command/config/list"46 configread "github.com/hashicorp/consul/command/config/read"47 configwrite "github.com/hashicorp/consul/command/config/write"48 "github.com/hashicorp/consul/command/connect"49 "github.com/hashicorp/consul/command/connect/ca"50 caget "github.com/hashicorp/consul/command/connect/ca/get"51 caset "github.com/hashicorp/consul/command/connect/ca/set"52 "github.com/hashicorp/consul/command/connect/envoy"53 "github.com/hashicorp/consul/command/connect/envoy/pipe-bootstrap"54 "github.com/hashicorp/consul/command/connect/proxy"55 "github.com/hashicorp/consul/command/debug"56 "github.com/hashicorp/consul/command/event"57 "github.com/hashicorp/consul/command/exec"58 "github.com/hashicorp/consul/command/forceleave"59 "github.com/hashicorp/consul/command/info"60 "github.com/hashicorp/consul/command/intention"61 ixncheck "github.com/hashicorp/consul/command/intention/check"62 ixncreate "github.com/hashicorp/consul/command/intention/create"63 ixndelete "github.com/hashicorp/consul/command/intention/delete"64 ixnget "github.com/hashicorp/consul/command/intention/get"65 ixnmatch "github.com/hashicorp/consul/command/intention/match"66 "github.com/hashicorp/consul/command/join"67 "github.com/hashicorp/consul/command/keygen"68 "github.com/hashicorp/consul/command/keyring"69 "github.com/hashicorp/consul/command/kv"70 kvdel "github.com/hashicorp/consul/command/kv/del"71 kvexp "github.com/hashicorp/consul/command/kv/exp"72 kvget "github.com/hashicorp/consul/command/kv/get"73 kvimp "github.com/hashicorp/consul/command/kv/imp"74 kvput "github.com/hashicorp/consul/command/kv/put"75 "github.com/hashicorp/consul/command/leave"76 "github.com/hashicorp/consul/command/lock"77 login "github.com/hashicorp/consul/command/login"78 logout "github.com/hashicorp/consul/command/logout"79 "github.com/hashicorp/consul/command/maint"80 "github.com/hashicorp/consul/command/members"81 "github.com/hashicorp/consul/command/monitor"82 "github.com/hashicorp/consul/command/operator"83 operauto "github.com/hashicorp/consul/command/operator/autopilot"84 operautoget "github.com/hashicorp/consul/command/operator/autopilot/get"85 operautoset "github.com/hashicorp/consul/command/operator/autopilot/set"86 operraft "github.com/hashicorp/consul/command/operator/raft"87 operraftlist "github.com/hashicorp/consul/command/operator/raft/listpeers"88 operraftremove "github.com/hashicorp/consul/command/operator/raft/removepeer"89 "github.com/hashicorp/consul/command/reload"90 "github.com/hashicorp/consul/command/rtt"91 "github.com/hashicorp/consul/command/services"92 svcsderegister "github.com/hashicorp/consul/command/services/deregister"93 svcsregister "github.com/hashicorp/consul/command/services/register"94 "github.com/hashicorp/consul/command/snapshot"95 snapinspect "github.com/hashicorp/consul/command/snapshot/inspect"96 snaprestore "github.com/hashicorp/consul/command/snapshot/restore"97 snapsave "github.com/hashicorp/consul/command/snapshot/save"98 "github.com/hashicorp/consul/command/tls"99 tlsca "github.com/hashicorp/consul/command/tls/ca"100 tlscacreate "github.com/hashicorp/consul/command/tls/ca/create"101 tlscert "github.com/hashicorp/consul/command/tls/cert"102 tlscertcreate "github.com/hashicorp/consul/command/tls/cert/create"103 "github.com/hashicorp/consul/command/validate"104 "github.com/hashicorp/consul/command/version"105 "github.com/hashicorp/consul/command/watch"106 consulversion "github.com/hashicorp/consul/version"107 "github.com/mitchellh/cli"108)109func init() {110 rev := consulversion.GitCommit111 ver := consulversion.Version112 verPre := consulversion.VersionPrerelease113 verHuman := consulversion.GetHumanVersion()114 Register("acl", func(cli.Ui) (cli.Command, error) { return acl.New(), nil })115 Register("acl bootstrap", func(ui cli.Ui) (cli.Command, error) { return aclbootstrap.New(ui), nil })116 Register("acl policy", func(cli.Ui) (cli.Command, error) { return aclpolicy.New(), nil })117 Register("acl policy create", func(ui cli.Ui) (cli.Command, error) { return aclpcreate.New(ui), nil })118 Register("acl policy list", func(ui cli.Ui) (cli.Command, error) { return aclplist.New(ui), nil })119 Register("acl policy read", func(ui cli.Ui) (cli.Command, error) { return aclpread.New(ui), nil })...

Full Screen

Full Screen

command.go

Source:command.go Github

copy

Full Screen

...4 "fmt"5 "os"6 "strings"7)8// Command represents a command that may be run by the user9type Command struct {10 name string11 commandPath string12 shortdescription string13 longdescription string14 subCommands []*Command15 subCommandsMap map[string]*Command16 longestSubcommand int17 actionCallback Action18 app *Cli19 flags *flag.FlagSet20 flagCount int21 helpFlag bool22 hidden bool23}24// NewCommand creates a new Command25// func NewCommand(name string, description string, app *Cli, parentCommandPath string) *Command {26func NewCommand(name string, description string) *Command {27 result := &Command{28 name: name,29 shortdescription: description,30 subCommandsMap: make(map[string]*Command),31 hidden: false,32 }33 return result34}35func (c *Command) setParentCommandPath(parentCommandPath string) {36 // Set up command path37 if parentCommandPath != "" {38 c.commandPath += parentCommandPath + " "39 }40 c.commandPath += c.name41 // Set up flag set42 c.flags = flag.NewFlagSet(c.commandPath, flag.ContinueOnError)43 c.BoolFlag("help", "Get help on the '"+strings.ToLower(c.commandPath)+"' command.", &c.helpFlag)44}45func (c *Command) setApp(app *Cli) {46 c.app = app47}48// parseFlags parses the given flags49func (c *Command) parseFlags(args []string) ([]string, error) {50 if len(args) == 0 {51 return args, nil52 }53 tmp := os.Stderr54 os.Stderr = nil55 err := c.flags.Parse(args)56 os.Stderr = tmp57 return c.flags.Args(), err58}59// Run - Runs the Command with the given arguments60func (c *Command) run(args []string) error {61 // Parse flags62 args, err := c.parseFlags(args)63 if err != nil {64 fmt.Printf("Error: %s\n\n", err.Error())65 c.PrintHelp()66 return err67 }68 // Help takes precedence69 if c.helpFlag {70 c.PrintHelp()71 return nil72 }73 // Check for subcommand74 if len(args) > 0 {75 subcommand := c.subCommandsMap[args[0]]76 if subcommand != nil {77 return subcommand.run(args[1:])78 }79 }80 // Do we have an action?81 if c.actionCallback != nil {82 return c.actionCallback()83 }84 // If we haven't specified a subcommand85 // check for an app level default command86 if c.app.defaultCommand != nil {87 // Prevent recursion!88 if c.app.defaultCommand != c {89 // only run default command if no args passed90 if len(args) == 0 {91 return c.app.defaultCommand.run(args)92 }93 }94 }95 // Nothing left we can do96 c.PrintHelp()97 return nil98}99// Action - Define an action from this command100func (c *Command) Action(callback Action) *Command {101 c.actionCallback = callback102 return c103}104// PrintHelp - Output the help text for this command105func (c *Command) PrintHelp() {106 if c.app != nil {107 c.app.PrintBanner()108 }109 commandTitle := c.commandPath110 if c.shortdescription != "" {111 commandTitle += " - " + c.shortdescription112 }113 // Ignore root command114 if c.commandPath != c.name {115 fmt.Println(commandTitle)116 }117 if c.longdescription != "" {118 fmt.Println(c.longdescription + "\n")119 }120 if len(c.subCommands) > 0 {121 fmt.Println("Available commands:")122 fmt.Println("")123 for _, subcommand := range c.subCommands {124 if subcommand.isHidden() {125 continue126 }127 spacer := strings.Repeat(" ", 3+c.longestSubcommand-len(subcommand.name))128 isDefault := ""129 if subcommand.isDefaultCommand() {130 isDefault = "[default]"131 }132 fmt.Printf(" %s%s%s %s\n", subcommand.name, spacer, subcommand.shortdescription, isDefault)133 }134 fmt.Println("")135 }136 if c.flagCount > 0 {137 fmt.Print("Flags:\n\n")138 c.flags.SetOutput(os.Stdout)139 c.flags.PrintDefaults()140 c.flags.SetOutput(os.Stderr)141 }142 fmt.Println()143}144// isDefaultCommand returns true if called on the default command145func (c *Command) isDefaultCommand() bool {146 if c.app == nil {147 return false148 }149 return c.app.defaultCommand == c150}151// isHidden returns true if the command is a hidden command152func (c *Command) isHidden() bool {153 return c.hidden154}155// Hidden hides the command from the Help system156func (c *Command) Hidden() {157 c.hidden = true158}159// NewSubCommand - Creates a new subcommand160func (c *Command) NewSubCommand(name, description string) *Command {161 result := NewCommand(name, description)162 c.AddCommand(result)163 return result164}165// AddCommand - Adds a subcommand166func (c *Command) AddCommand(command *Command) {167 command.setApp(c.app)168 command.setParentCommandPath(c.commandPath)169 name := command.name170 c.subCommands = append(c.subCommands, command)171 c.subCommandsMap[name] = command172 if len(name) > c.longestSubcommand {173 c.longestSubcommand = len(name)174 }175}176// BoolFlag - Adds a boolean flag to the command177func (c *Command) BoolFlag(name, description string, variable *bool) *Command {178 c.flags.BoolVar(variable, name, *variable, description)179 c.flagCount++180 return c181}182// StringFlag - Adds a string flag to the command183func (c *Command) StringFlag(name, description string, variable *string) *Command {184 c.flags.StringVar(variable, name, *variable, description)185 c.flagCount++186 return c187}188// IntFlag - Adds an int flag to the command189func (c *Command) IntFlag(name, description string, variable *int) *Command {190 c.flags.IntVar(variable, name, *variable, description)191 c.flagCount++192 return c193}194// LongDescription - Sets the long description for the command195func (c *Command) LongDescription(longdescription string) *Command {196 c.longdescription = longdescription197 return c198}199// OtherArgs - Returns the non-flag arguments passed to the subcommand. NOTE: This should only be called within the context of an action.200func (c *Command) OtherArgs() []string {201 return c.flags.Args()202}...

Full Screen

Full Screen

root.go

Source:root.go Github

copy

Full Screen

1package commands2import (3 "os"4 "github.com/spf13/cobra"5 "github.com/xcloudnative/xcloud/pkg/util/cmd"6 "k8s.io/client-go/tools/clientcmd"7)8const (9 // CLIName is the name of the CLI10 CLIName = "xflow-controller"11)12// NewCommand returns a new instance of an argo command13func NewCommand() *cobra.Command {14 var command = &cobra.Command{15 Use: CLIName,16 Short: "xflow-controller is the command line interface to Argo",17 Run: func(cmd *cobra.Command, args []string) {18 cmd.HelpFunc()(cmd, args)19 },20 }21 command.AddCommand(NewCompletionCommand())22 command.AddCommand(NewDeleteCommand())23 command.AddCommand(NewGetCommand())24 command.AddCommand(NewLintCommand())25 command.AddCommand(NewListCommand())26 command.AddCommand(NewLogsCommand())27 command.AddCommand(NewResubmitCommand())28 command.AddCommand(NewResumeCommand())29 command.AddCommand(NewRetryCommand())30 command.AddCommand(NewSubmitCommand())31 command.AddCommand(NewSuspendCommand())32 command.AddCommand(NewWaitCommand())33 command.AddCommand(NewWatchCommand())34 command.AddCommand(NewTerminateCommand())35 command.AddCommand(cmd.NewVersionCmd(CLIName))36 addKubectlFlagsToCmd(command)37 return command38}39func addKubectlFlagsToCmd(cmd *cobra.Command) {40 // The "usual" clientcmd/kubectl flags41 loadingRules := clientcmd.NewDefaultClientConfigLoadingRules()42 loadingRules.DefaultClientConfig = &clientcmd.DefaultClientConfig43 overrides := clientcmd.ConfigOverrides{}44 kflags := clientcmd.RecommendedConfigOverrideFlags("")45 cmd.PersistentFlags().StringVar(&loadingRules.ExplicitPath, "kubeconfig", "", "Path to a kube config. Only required if out-of-cluster")46 clientcmd.BindOverrideFlags(&overrides, cmd.PersistentFlags(), kflags)47 clientConfig = clientcmd.NewInteractiveDeferredLoadingClientConfig(loadingRules, &overrides, os.Stdin)48}...

Full Screen

Full Screen

command

Using AI Code Generation

copy

Full Screen

1use \mageekguy\atoum\scripts\runner;2use \mageekguy\atoum\report\fields\runner\result\cli;3use \mageekguy\atoum\report\fields\runner\failures\cli;4use \mageekguy\atoum\report\fields\runner\outputs\cli;5use \mageekguy\atoum\report\fields\runner\errors\cli;6use \mageekguy\atoum\report\fields\runner\exceptions\cli;7use \mageekguy\atoum\report\fields\runner\tests\cli;8use \mageekguy\atoum\report\fields\runner\duration\cli;9use \mageekguy\atoum\report\fields\runner\memory\cli;10use \mageekguy\atoum\report\fields\runner\coverage\html;11use \mageekguy\atoum\report\fields\runner\coverage\clover;12use \mageekguy\atoum\report\fields\runner\coverage\php;13use \mageekguy\atoum\report\fields\runner\coverage\text;14use \mageekguy\atoum\report\fields\runner\coverage\xml;15use \mageekguy\atoum\report\fields\runner\coverage\badge;16use \mageekguy\atoum\report\fields\runner\coverage\badge\svg;17use \mageekguy\atoum\report\fields\runner\coverage\badge\shield;18use \mageekguy\atoum\report\fields\runner\coverage\badge\travis;19use \mageekguy\atoum\report\fields\runner\coverage\badge\coveralls;20use \mageekguy\atoum\report\fields\runner\coverage\badge\coveralls\service\travis;21use \mageekguy\atoum\report\fields\runner\coverage\badge\coveralls\service\circleci;22use \mageekguy\atoum\report\fields\runner\coverage\badge\coveralls\service\jenkins;

Full Screen

Full Screen

command

Using AI Code Generation

copy

Full Screen

1use \mageekguy\atoum;2use \mageekguy\atoum\reports;3use \mageekguy\atoum\reports\asynchronous;4use \mageekguy\atoum\reports\asynchronous\file;5use \mageekguy\atoum\reports\asynchronous\file\evolution;6use \mageekguy\atoum\reports\asynchronous\file\evolution\html;7use \mageekguy\atoum\reports\asynchronous\file\xunit;8use \mageekguy\atoum\reports\asynchronous\file\xunit\html;9use \mageekguy\atoum\reports\realtime;10use \mageekguy\atoum\reports\realtime\cli;11use \mageekguy\atoum\reports\realtime\cli\green;12use \mageekguy\atoum\reports\realtime\cli\red;13use \mageekguy\atoum\reports\realtime\cli\yellow;14use \mageekguy\atoum\reports\realtime\cli\white;15use \mageekguy\atoum\reports\realtime\cli\cyan;16use \mageekguy\atoum\reports\realtime\cli\magenta;17use \mageekguy\atoum\reports\realtime\cli\blue;

Full Screen

Full Screen

command

Using AI Code Generation

copy

Full Screen

1use \mageekguy\atoum\command;2use \mageekguy\atoum\command\line;3use \mageekguy\atoum\command\runner;4use \mageekguy\atoum\command\runner;5use \mageekguy\atoum\command\runner;6use \mageekguy\atoum\command\runner;7use \mageekguy\atoum\command\runner;8use \mageekguy\atoum\command\runner;9use \mageekguy\atoum\command\runner;10use \mageekguy\atoum\command\runner;11use \mageekguy\atoum\command\runner;12use \mageekguy\atoum\command\runner;13use \mageekguy\atoum\command\runner;14use \mageekguy\atoum\command\runner;15use \mageekguy\atoum\command\runner;16use \mageekguy\atoum\command\runner;17use \mageekguy\atoum\command\runner;18use \mageekguy\atoum\command\runner;19use \mageekguy\atoum\command\runner;

Full Screen

Full Screen

command

Using AI Code Generation

copy

Full Screen

1$test->assert->class('command')->hasInterface('commandInterface');2$test->assert->class('command')->hasInterface('commandInterface');3$test->assert->class('command')->hasInterface('commandInterface');4$test->assert->class('command')->hasInterface('commandInterface');5$test->assert->class('command')->hasInterface('commandInterface');6$test->assert->class('command')->hasInterface('commandInterface');7$test->assert->class('command')->hasInterface('commandInterface');8$test->assert->class('command')->hasInterface('commandInterface');9$test->assert->class('command')->hasInterface('commandInterface');10$test->assert->class('command')->hasInterface('commandInterface');11$test->assert->class('command')->hasInterface('commandInterface');12$test->assert->class('command')->hasInterface('commandInterface');13$test->assert->class('command')->hasInterface('commandInterface');14$test->assert->class('command')->hasInterface('commandInterface');15$test->assert->class('command')->hasInterface('commandInterface');

Full Screen

Full Screen

command

Using AI Code Generation

copy

Full Screen

1$command = new \mageekguy\atoum\scripts\runner();2$command->setRootDirectory(__DIR__);3$command->setPhpPath('/usr/bin/php');4$command->setBootstrapFile(__DIR__ . '/bootstrap.php');5$command->setAtoumPath(__DIR__ . '/vendor/bin/atoum');6$command->setCodeCoveragePath(__DIR__ . '/vendor/bin/atoum');7$command->run(array(8));9PHP Warning: require(/var/www/html/atoum/vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/atoum/tests/bootstrap.php on line 410PHP 1. {main}() /var/www/html/atoum/1.php:011PHP 2. mageekguy\atoum\scripts\runner->run() /var/www/html/atoum/1.php:1512PHP 3. mageekguy\atoum\scripts\runner->run() /var/www/html/atoum/vendor/atoum/atoum/classes/scripts/runner.php:013PHP 4. mageekguy\atoum\scripts\runner->run() /var/www/html/atoum/vendor/atoum/atoum/classes/scripts/runner.php:014PHP 5. mageekguy\atoum\scripts\runner->run() /var/www/html/atoum/vendor/atoum/atoum/classes/scripts/runner.php:015PHP 6. mageekguy\atoum\scripts\runner->run() /var/www/html/atoum/vendor/atoum/atoum/classes/scripts/runner.php:016PHP 7. mageekguy\atoum\scripts\runner->run() /var/www/html/atoum/vendor/atoum/atoum/classes/scripts/runner.php:017PHP 8. mageekguy\atoum\scripts\runner->run() /var/www/html/atoum/vendor/atoum/atou

Full Screen

Full Screen

command

Using AI Code Generation

copy

Full Screen

1$command = new \mageekguy\atoum\scripts\runner();2$command->setRootDirectory(__DIR__);3$command->setPhpPath('php');4$command->setPhpPath('php');5$command->addDefaultReport();6$command->run();7$command = new \mageekguy\atoum\scripts\runner();8$command->setRootDirectory(__DIR__);9$command->setPhpPath('php');10$command->setPhpPath('php');11$command->addDefaultReport();12$command->run();13$command = new \mageekguy\atoum\scripts\runner();14$command->setRootDirectory(__DIR__);15$command->setPhpPath('php');16$command->setPhpPath('php');17$command->addDefaultReport();18$command->run();19$command = new \mageekguy\atoum\scripts\runner();20$command->setRootDirectory(__DIR__);21$command->setPhpPath('php');22$command->setPhpPath('php');23$command->addDefaultReport();24$command->run();25$command = new \mageekguy\atoum\scripts\runner();26$command->setRootDirectory(__DIR__);27$command->setPhpPath('php');28$command->setPhpPath('php');29$command->addDefaultReport();30$command->run();31$command = new \mageekguy\atoum\scripts\runner();32$command->setRootDirectory(__DIR__);33$command->setPhpPath('php');34$command->setPhpPath('php');35$command->addDefaultReport();36$command->run();37$command = new \mageekguy\atoum\scripts\runner();38$command->setRootDirectory(__DIR__);39$command->setPhpPath('php');40$command->setPhpPath('php');

Full Screen

Full Screen

command

Using AI Code Generation

copy

Full Screen

1$command = new \mageekguy\atoum\scripts\runner();2$command->run(array('path/to/runner.php', '-f', 'path/to/1.php'));3$command = new \mageekguy\atoum\scripts\runner();4$command->run(array('path/to/runner.php', '-f', 'path/to/2.php'));5$command = new \mageekguy\atoum\scripts\runner();6$command->run(array('path/to/runner.php', '-f', 'path/to/3.php'));7$command = new \mageekguy\atoum\scripts\runner();8$command->run(array('path/to/runner.php', '-f', 'path/to/4.php'));

Full Screen

Full Screen

command

Using AI Code Generation

copy

Full Screen

1use \mageekguy\atoum;2$command = new atoum\command;3$command->setArguments(array('test.php', 'test.php'));4$command->setOptions(array('test.php', 'test.php'));5$command->setArguments(array('test.php', 'test.php'));6$command->setOptions(array('test.php', 'test.php'));7$command->run();8use \mageekguy\atoum;9$command = new atoum\command;10$command->setArguments(array('test.php', 'test.php'));11$command->setOptions(array('test.php', 'test.php'));12$command->run();13use \mageekguy\atoum;14$command = new atoum\command;15$command->setArguments(array('test.php', 'test.php'));16$command->setOptions(array('test.php', 'test.php'));17$command->run();18use \mageekguy\atoum;19$command = new atoum\command;20$command->setArguments(array('test.php', 'test.php'));21$command->setOptions(array('test.php', 'test.php'));22$command->run();23use \mageekguy\atoum;24$command = new atoum\command;

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Atoum automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Run Selenium Automation Tests on LambdaTest Cloud Grid

Trigger Selenium automation tests on a cloud-based Grid of 3000+ real browsers and operating systems.

Test now for Free

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful