commit ab2f51513a8a0ed707792fc80cdf8cb63baae9d1
Author: Alexandre Correia <alexandrecorreia@celepar.pr.gov.br>
Date:   Wed Sep 1 17:48:18 2021 -0300

    Issue #905 - Scripts para importação do sieve

diff --git a/app/Console/Commands/Expresso/SieveGetUid.php b/app/Console/Commands/Expresso/SieveGetUid.php
index 5f498e7..7f698f5 100755
--- a/app/Console/Commands/Expresso/SieveGetUid.php
+++ b/app/Console/Commands/Expresso/SieveGetUid.php
@@ -13,14 +13,14 @@ class SieveGetUid extends Command
      *
      * @var string
      */
-    protected $signature = 'expresso:sieve-get {--u|uid=} {cmd?}';
+    protected $signature = 'expresso:get-user-sieve-filters-by-line {--u|uid=} {cmd?}';
 
     /**
      * The console command description.
      *
      * @var string
      */
-    protected $description = 'Lista os scripts sieve do usuario';
+    protected $description = 'lista os filtros de usuários ( entrada: usuários separados por vírgula )';
 
     /**
      * Create a new command instance.
@@ -43,50 +43,42 @@ class SieveGetUid extends Command
 
         $uid = $this->option('uid') ?? null;
 
-        if( isset($arguments['cmd']) && $arguments['cmd'] == 'help' )
-        {
-            $this->help();
-
-        } else {
-
-            if( !is_null($uid) ){
-
-                $sieveRules = $this->getSieveRules($uid);
-                
-                if( isset($arguments['cmd']) && $arguments['cmd'] == 'print' )
-                {
-                    $rules      = [];
-                    foreach( $sieveRules as $key => $sieve ){
-                        $rules[$key]['regra']       = unserialize( $sieve->rule );
-                        $rules[$key]['habilitada']  = $sieve->is_enabled;
-                        $rules[$key]['dt_criacao']  = date('d/m/Y', strtotime($sieve->created_dt));
-                        
-                        print_r( $rules[$key] );
-                    }
-                }
-
-                if( isset($arguments['cmd']) && $arguments['cmd'] == 'file' )
-                {
-                    $lines = "Usuario : " . $uid . PHP_EOL;
 
-                    foreach( $sieveRules as $key => $sieve ){
-                        $lines .= "regra      : " . $sieve->rule . PHP_EOL;
-                        $lines .= "habilitada : " . $sieve->is_enabled . PHP_EOL;
-                        $lines .= "dt_criacao : " . date('d/m/Y', strtotime($sieve->created_dt)) . PHP_EOL;
-                        $lines .= "************************************************************************" . PHP_EOL . PHP_EOL;
-                    }
+        if( !is_null($uid) ){
 
-                    Storage::put('file/file_'.$uid.'.txt', $lines );
+            $sieveRules = $this->getSieveRules($uid);
+            
+            if( isset($arguments['cmd']) && $arguments['cmd'] == 'print' )
+            {
+                $rules      = [];
+                foreach( $sieveRules as $key => $sieve ){
+                    $rules[$key]['regra']       = unserialize( $sieve->rule );
+                    $rules[$key]['habilitada']  = $sieve->is_enabled;
+                    $rules[$key]['dt_criacao']  = date('d/m/Y', strtotime($sieve->created_dt));
+                    
+                    print_r( $rules[$key] );
                 }
+            }
 
-                if( isset($arguments['cmd']) && $arguments['cmd'] == 'fileSogo' )
-                {
-                    print_r( storage_path('fileSogo') );
+            if( isset($arguments['cmd']) && $arguments['cmd'] == 'file' )
+            {
+                $lines = "Usuario : " . $uid . PHP_EOL;
+
+                foreach( $sieveRules as $key => $sieve ){
+                    $lines .= "regra      : " . $sieve->rule . PHP_EOL;
+                    $lines .= "habilitada : " . $sieve->is_enabled . PHP_EOL;
+                    $lines .= "dt_criacao : " . date('d/m/Y', strtotime($sieve->created_dt)) . PHP_EOL;
+                    $lines .= "************************************************************************" . PHP_EOL . PHP_EOL;
                 }
+
+                Storage::put('file/file_'.$uid.'.txt', $lines );
             }
-        }
 
-        $this->newLine();
+            if( isset($arguments['cmd']) && $arguments['cmd'] == 'fileSogo' )
+            {
+                print_r( storage_path('fileSogo') );
+            }
+        }
     }
 
     private function getSieveRules( $user )
@@ -98,12 +90,4 @@ class SieveGetUid extends Command
 
         return $sieveRules;
     }
-
-    private function help()
-    {
-        $this->newLine();
-        $this->info('EXEMPLO DE UTILIZACAO : ');
-        $this->info('Ex: php artisan expresso:sieve-get --uid=<000000> { print | file | fileSogo }');
-        $this->newLine();
-    }
 }
\ No newline at end of file
