Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Command.php

function Command::addUsage

Add a command usage example, it'll be prefixed with the command name.

Return value

$this

2 methods override Command::addUsage()
LazyCommand::addUsage in vendor/symfony/console/Command/LazyCommand.php
Add a command usage example, it'll be prefixed with the command name.
TraceableCommand::addUsage in vendor/symfony/console/Command/TraceableCommand.php
Add a command usage example, it'll be prefixed with the command name.

File

vendor/symfony/console/Command/Command.php, line 617

Class

Command
Base class for all commands.

Namespace

Symfony\Component\Console\Command

Code

public function addUsage(string $usage) : static {
    if (!str_starts_with($usage, $this->name)) {
        $usage = \sprintf('%s %s', $this->name, $usage);
    }
    $this->usages[] = $usage;
    return $this;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal