Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2891599
prompt.php
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
859 B
Referenced Files
None
Subscribers
None
prompt.php
View Options
#!/usr/bin/env php
<?php
require_once
dirname
(
__FILE__
)
.
'/../__init_script__.php'
;
$args
=
new
PhutilArgumentParser
(
$argv
)
;
$args
->
setTagline
(
pht
(
'test console prompting'
)
)
;
$args
->
setSynopsis
(
<<<EOHELP
**prompt.php** __options__
Test console prompting.
EOHELP
)
;
$args
->
parseStandardArguments
(
)
;
$args
->
parse
(
array
(
array
(
'name'
=>
'history'
,
'param'
=>
'file'
,
'default'
=>
''
,
'help'
=>
pht
(
'Use specified history __file__.'
)
,
)
,
array
(
'name'
=>
'prompt'
,
'param'
=>
'text'
,
'default'
=>
pht
(
'Enter some text:'
)
,
'help'
=>
pht
(
'Change the prompt text to __text__.'
)
,
)
,
)
)
;
$result
=
phutil_console_prompt
(
$args
->
getArg
(
'prompt'
)
,
$args
->
getArg
(
'history'
)
)
;
$console
=
PhutilConsole
::
getConsole
(
)
;
$console
->
writeOut
(
"%s\n"
,
pht
(
'Input is: %s'
,
$result
)
)
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 19, 15:26 (3 w, 23 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1125981
Default Alt Text
prompt.php (859 B)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment