https://wiki.kolmafia.us/index.php?title=Cli_execute_output&feed=atom&action=historyCli execute output - Revision history2024-03-29T02:38:27ZRevision history for this page on the wikiMediaWiki 1.35.0https://wiki.kolmafia.us/index.php?title=Cli_execute_output&diff=8919&oldid=prevPhilmasterplus: Created page with "<onlyinclude>{{{{{format|Function2}}} |name=cli_execute_output |function1.return_type=string |function1.description=Executes a gCLI command, capturing and returning the gCLI o..."2020-12-23T14:52:07Z<p>Created page with "<onlyinclude>{{{{{format|Function2}}} |name=cli_execute_output |function1.return_type=string |function1.description=Executes a gCLI command, capturing and returning the gCLI o..."</p>
<p><b>New page</b></p><div><onlyinclude>{{{{{format|Function2}}}<br />
|name=cli_execute_output<br />
|function1.return_type=string<br />
|function1.description=Executes a gCLI command, capturing and returning the gCLI output.<br />
|function1.param1=command<br />
|function1.param1.type=string<br />
|function1.param1.description=gCLI command to execute<br />
|description=<p>This function behaves like {{f|cli_execute}}, except that it captures the text printed to the gCLI and returns it as a string. This can be used to manually parse the gCLI output.</p><br />
<br />
<p>This does ''not'' suppress the gCLI output. Rather, it </p><br />
<br />
<p>The returned string contains the raw HTML output.</p><br />
|code1={{CodeSample<br />
|title=Code Samples<br />
|description=Capture the output of the <code>ashref</code> command and save it to a file.<br />
|code=<br />
<syntaxhighlight lang="d"><br />
buffer b;<br />
b.append( cli_execute_output( "ashref" );<br />
if ( !buffer_to_file( b, "ashref.txt" ) )<br />
{<br />
abort( "Failed to save ashref.txt" );<br />
}<br />
</syntaxhighlight><br />
|moreinfo=<br />
}}<br />
|see_also={{SeeAlso/gCLI Functions}}<br />
|cli_equiv=<br />
|more_info=<br />
|special=<br />
|{{{1|}}}<br />
}}</onlyinclude><br />
[[Category:Miscellaneous Functions]]</div>Philmasterplus