Returns the path to the first command found in the list.

@return string|null The located command, or null if none could be found.
541726
public function get()
    {
        foreach ($this->_commands as $command) {
            $location = $this->_commandLocator->locate(basename($command));
            if ($location !== null) {
                return $location;
            }
        }

        return null;
    }
1217468
public function isFirst()
    {
        $parent = $this->parent();
        $collection = $parent ? $parent->collection('content', false) : null;
        if ($collection instanceof Collection) {
            return $collection->isFirst($this->path());
        }

        return true;
    }
512895
public static function getCommand() {
		foreach (self::$commands as $command => $attributes) {
			if (isset(self::$options[$command]) || isset(self::$options[$attributes["commandShort"]])) {
				return $command;
			}
		}
		return false;
	}
1192818
protected function first()
    {
        foreach ($this->sortable as $key => $value) {
            if (is_numeric($key)) {
                return $value;
            }

            return $key;
        }

        return null;
    }
886628
public function getSubPath()
    {
        if ($this->hasChildren()) {
            $path = $this->getFilename();
            $name = $this->getBasename();
            return str_replace($name, '', $path);
        }
        return null;
    }
189487
public function first()
    {
        $sql = clone($this);
        $sql->limit(1);
        $collection = $this->query($sql);
        return $collection->isEmpty() ? null : $collection[0];
    }
749690
protected function notFound()
    {
        $closest   = [];
        $attempted = $this->argv[1];
        $available = \array_keys($this->commands() + $this->aliases);

        foreach ($available as $cmd) {
            $lev = \levenshtein($attempted, $cmd);
            if ($lev > 0 || $lev < 5) {
                $closest[$cmd] = $lev;
            }
        }

        $this->io()->error("Command $attempted not found", true);
        if ($closest) {
            \asort($closest);
            $closest = \key($closest);
            $this->io()->bgRed("Did you mean $closest?", true);
        }

        return ($this->onExit)(127);
    }
1177627
public function basePath()
    {
        if ($this->dirname && $this->basename) {
            return ($this->dirname .'/'. $this->basename);
        }

        return null;
    }
1358607
public function getCommand()
    {
        if (is_null($this->commandName)) {
            throw new \RuntimeException("You should pass a commandName to execute a command");
        }

        $command = '';
        $command .= $this->getCLIConfigs();
        $command .= $this->getCLIGlobalOptions();
        $command .= $this->getCLICommandName();
        $command .= $this->getCLICommandArguments();
        $command .= $this->getCLISubjects();
        $command .= $this->getCLIPath();

        $command = preg_replace('/\\s{2,}/', ' ', $command);

        return trim($command);
    }
375469
public function getCommand(): Command
    {
        if ($this->command === null) {
            $this->command = new Command($this->controllerObjectName, $this->controllerCommandName);
        }
        return $this->command;
    }
126137
public function getCommand()
    {
        $options = $this->getOptions();
        $arguments = $this->getArguments();

        $to = null;
        $from = $arguments['from'];

        if (true === isset($arguments['to'])) {
            $to = $arguments['to'];
        }

        array_walk($options, function (&$option) {
            $option = '--' . $option;
        });

        array_walk($arguments, function (&$value, $argument) {
            $value = '--' . $argument . '=' . $value;
        });

        return trim(sprintf('%s %s %s', $this->getBaseCommand(), $this->getRange($from, $to), join(' ', $options)));
    }
165111
public function first()
    {
        $this->executeBeforeCallback();

        return count($this->items) > 0 ? reset($this->items) : null;
    }
232899
public function getPath() : string
   {

      if ( '' === $this->path )
      {
         return '/';
      }

      if ( ! \Niirrty\strStartsWith( $this->path, '/' ) )
      {
         return '/' . $this->path;
      }

      return $this->path;

   }
1225703
public function get($command = null)
    {
        if (isset($command)) {
            $routes = $this->getList();
            return isset($routes[$command]) ? $routes[$command] : array();
        }

        return $this->route;
    }
953750
public function getThumbPath()
    {
        return (!empty($this->thumb_path) ? str_replace($this->getThumbRootDir(), '', DirectoryHelper::slashDirname($this->thumb_path)) : '');
    }
564919
public function getRelativePath()
    {
        if ($this->file !== null) {
            return dirname($this->file->getForLocalProcessing(false)) . '/';
        } else {
            return str_replace(PATH_site, '', $this->fileInfo['path']);
        }
    }
1250692
public static function getCommandPath($cmd)
    {
        $os_cmd = exec('which '.$cmd);
        if (empty($os_cmd)) {
            throw new CommandNotFoundException($cmd);
        }
        return $os_cmd;
    }