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

Breadcrumb

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

function Console_Getopt::_isShortOpt

Checks if an argument is a short option

Parameters

string $arg Argument to check:

Return value

bool

2 calls to Console_Getopt::_isShortOpt()
Console_Getopt::_parseLongOption in vendor/pear/console_getopt/Console/Getopt.php
Parse long option
Console_Getopt::_parseShortOption in vendor/pear/console_getopt/Console/Getopt.php
Parse short option

File

vendor/pear/console_getopt/Console/Getopt.php, line 242

Class

Console_Getopt
Command-line options parsing class.

Code

protected static function _isShortOpt($arg) {
    return strlen($arg) == 2 && $arg[0] == '-' && preg_match('/[a-zA-Z]/', $arg[1]);
}

API Navigation

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