Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101270709
PhutilHelpArgumentWorkflow.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Feb 7, 08:55
Size
992 B
Mime Type
text/x-php
Expires
Sun, Feb 9, 08:55 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
24127812
Attached To
rPHU libphutil
PhutilHelpArgumentWorkflow.php
View Options
<?php
final
class
PhutilHelpArgumentWorkflow
extends
PhutilArgumentWorkflow
{
protected
function
didConstruct
()
{
$this
->
setName
(
'help'
);
$this
->
setExamples
(
<<<EOHELP
**help** [__command__]
EOHELP
);
$this
->
setSynopsis
(
<<<EOHELP
Show this help, or workflow help for __command__.
EOHELP
);
$this
->
setArguments
(
array
(
array
(
'name'
=>
'help-with-what'
,
'wildcard'
=>
true
,
),
));
}
public
function
isExecutable
()
{
return
true
;
}
public
function
execute
(
PhutilArgumentParser
$args
)
{
$with
=
$args
->
getArg
(
'help-with-what'
);
if
(!
$with
)
{
$args
->
printHelpAndExit
();
}
else
{
foreach
(
$with
as
$thing
)
{
echo
phutil_console_format
(
"**%s**
\n\n
"
,
pht
(
'%s WORKFLOW'
,
strtoupper
(
$thing
)));
echo
$args
->
renderWorkflowHelp
(
$thing
,
$show_flags
=
true
);
echo
"
\n
"
;
}
exit
(
PhutilArgumentParser
::
PARSE_ERROR_CODE
);
}
}
}
Event Timeline
Log In to Comment