PHP 클래스 WP_CLI\Dispatcher\Subcommand

상속: extends WP_CLI\Dispatcher\CompositeCommand
파일 보기 프로젝트 열기: wp-cli/wp-cli

공개 메소드들

메소드 설명
__construct ( $parent, $name, $docparser, $when_invoked )
can_have_subcommands ( ) : boolean Subcommands can't have subcommands because they represent code to be executed.
get_alias ( ) : string If an alias is set, grant access to it.
get_synopsis ( ) : string Get the synopsis string for this subcommand.
get_usage ( string $prefix ) : string Get the usage of the subcommand as a formatted string.
invoke ( array $args, array $assoc_args, $extra_args ) Invoke the subcommand with the supplied arguments.
set_synopsis ( $synopsis ) Set the synopsis string for this subcommand.
show_usage ( string $prefix = 'usage: ' ) Print the usage details to the end user.

비공개 메소드들

메소드 설명
extract_synopsis ( string $longdesc ) : string Extract the synopsis from PHPdoc string.
prompt ( string $question, string $default ) : string | false Wrapper for CLI Tools' prompt() method.
prompt_args ( array $args, array $assoc_args ) : array Interactively prompt the user for input based on defined synopsis and passed arguments.
validate_args ( array $args, array $assoc_args, array $extra_args ) : array Validate the supplied arguments to the command.

메소드 상세

__construct() 공개 메소드

public __construct ( $parent, $name, $docparser, $when_invoked )

can_have_subcommands() 공개 메소드

Subcommands can't have subcommands because they represent code to be executed.
public can_have_subcommands ( ) : boolean
리턴 boolean

get_alias() 공개 메소드

Aliases permit subcommands to be instantiated with a secondary identity.
public get_alias ( ) : string
리턴 string

get_synopsis() 공개 메소드

A synopsis defines what runtime arguments are expected, useful to humans and argument validation.
public get_synopsis ( ) : string
리턴 string

get_usage() 공개 메소드

Get the usage of the subcommand as a formatted string.
public get_usage ( string $prefix ) : string
$prefix string
리턴 string

invoke() 공개 메소드

Given a --prompt argument, interactively request input from the end user.
public invoke ( array $args, array $assoc_args, $extra_args )
$args array
$assoc_args array

set_synopsis() 공개 메소드

Set the synopsis string for this subcommand.
public set_synopsis ( $synopsis )

show_usage() 공개 메소드

Print the usage details to the end user.
public show_usage ( string $prefix = 'usage: ' )
$prefix string