original_string: public function options($commandName, $subCommandName = '')
      {
          $Shell = $this->getShell($commandName);
  
          if (!$Shell) {
              return [];
          }
  
          $parser = $Shell->getOptionParser();
  
          if (!empty($subCommandName)) {
              $subCommandName = Inflector::camelize($subCommandName);
              if ($Shell->hasTask($subCommandName)) {
                  $parser = $Shell->{$subCommandName}->getOptionParser();
              } else {
                  return [];
              }
          }
  
          $options = [];
          $array = $parser->options();
          /* @var \Cake\Console\ConsoleInputOption $obj */
          foreach ($array as $name => $obj) {
              $options[] = "--$name";
              $short = $obj->short();
              if ($short) {
                  $options[] = "-$short";
              }
          }
  
          return $options;
      }
code: public function options($commandName, $subCommandName = '')
      {
          $Shell = $this->getShell($commandName);
  
          if (!$Shell) {
              return [];
          }
  
          $parser = $Shell->getOptionParser();
  
          if (!empty($subCommandName)) {
              $subCommandName = Inflector::camelize($subCommandName);
              if ($Shell->hasTask($subCommandName)) {
                  $parser = $Shell->{$subCommandName}->getOptionParser();
              } else {
                  return [];
              }
          }
  
          $options = [];
          $array = $parser->options();
          /* @var \Cake\Console\ConsoleInputOption $obj */
          foreach ($array as $name => $obj) {
              $options[] = "--$name";
              $short = $obj->short();
              if ($short) {
                  $options[] = "-$short";
              }
          }
  
          return $options;
      }
code_tokens: public function options ( $ commandName , $ subCommandName = '' ) { $ Shell = $ this -> getShell ( $ commandName ) ; if ( ! $ Shell ) { return [ ] ; } $ parser = $ Shell -> getOptionParser ( ) ; if ( ! empty ( $ subCommandName ) ) { $ subCommandName = Inflector :: camelize ( $ subCommandName ) ; if ( $ Shell -> hasTask ( $ subCommandName ) ) { $ parser = $ Shell -> { $ subCommandName } -> getOptionParser ( ) ; } else { return [ ] ; } } $ options = [ ] ; $ array = $ parser -> options ( ) ; /* @var \Cake\Console\ConsoleInputOption $obj */ foreach ( $ array as $ name => $ obj ) { $ options [ ] = "--$name" ; $ short = $ obj -> short ( ) ; if ( $ short ) { $ options [ ] = "-$short" ; } } return $ options ; }
docstring: Get options list for the given command or subcommand
  
  @param string $commandName The command to get options for.
  @param string $subCommandName The subcommand to get options for. Can be empty to get options for the command.
  If this parameter is used, the subcommand must be a valid subcommand of the command passed
  @return array Options list for the given command or subcommand
docstring_tokens: Get options list for the given command or subcommand