@@ -16,16 +16,15 @@ public function handle(): int
1616 {
1717 $ this ->withProgressBar ($ this ->argument ('module ' ), function ($ module ) {
1818 $ this ->newLine ();
19- $ this ->info ('Module: ' . $ module );
19+ $ this ->info ('Module: ' . $ module );
2020
2121 $ pm_builder = PermissionRelation::touch ($ module );
2222
2323 if ($ this ->option ('no-prefix ' )) {
2424 $ pm_builder ->disablePrefix ();
2525 }
2626
27- if ($ custom = $ this ->option ('custom ' )) {
28- $ custom = array_filter ($ custom );
27+ if ($ custom = array_filter ($ this ->option ('custom-set ' ))) {
2928 if (empty ($ custom )) {
3029 $ pm_builder ->addCustomSet ();
3130 } else {
@@ -40,6 +39,12 @@ public function handle(): int
4039 } else {
4140 $ pm_builder ->addResourceSet ();
4241 }
42+
43+ if ($ sets = array_filter ($ this ->option ('sets ' ))) {
44+ foreach ($ sets as $ set ) {
45+ $ pm_builder ->addSet ($ set );
46+ }
47+ }
4348 });
4449
4550 $ this ->newLine ();
@@ -58,9 +63,10 @@ protected function getOptions(): array
5863 {
5964 return [
6065 new InputOption ('no-prefix ' , null , InputOption::VALUE_NONE , 'Create permissions without touching module name. ' ),
61- new InputOption ('custom ' , 'c ' , InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY , 'List of custom attributes. ' ),
66+ new InputOption ('custom-set ' , 'c ' , InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY , 'List of custom attributes. ' ),
6267 new InputOption ('except ' , 'e ' , InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY , 'Skip this permissions. ' ),
6368 new InputOption ('only ' , 'o ' , InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY , 'Create only this. ' ),
69+ new InputOption ('set ' , 's ' , InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY , 'List of set names (from config file) ' ),
6470 ];
6571 }
6672}
0 commit comments