<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.kolmafia.us/index.php?action=history&amp;feed=atom&amp;title=Cli_execute_output</id>
	<title>Cli execute output - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.kolmafia.us/index.php?action=history&amp;feed=atom&amp;title=Cli_execute_output"/>
	<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Cli_execute_output&amp;action=history"/>
	<updated>2026-04-30T16:58:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Cli_execute_output&amp;diff=8919&amp;oldid=prev</id>
		<title>Philmasterplus: Created page with &quot;&lt;onlyinclude&gt;{{{{{format|Function2}}} |name=cli_execute_output |function1.return_type=string |function1.description=Executes a gCLI command, capturing and returning the gCLI o...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Cli_execute_output&amp;diff=8919&amp;oldid=prev"/>
		<updated>2020-12-23T14:52:07Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;onlyinclude&amp;gt;{{{{{format|Function2}}} |name=cli_execute_output |function1.return_type=string |function1.description=Executes a gCLI command, capturing and returning the gCLI o...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;onlyinclude&amp;gt;{{{{{format|Function2}}}&lt;br /&gt;
|name=cli_execute_output&lt;br /&gt;
|function1.return_type=string&lt;br /&gt;
|function1.description=Executes a gCLI command, capturing and returning the gCLI output.&lt;br /&gt;
|function1.param1=command&lt;br /&gt;
|function1.param1.type=string&lt;br /&gt;
|function1.param1.description=gCLI command to execute&lt;br /&gt;
|description=&amp;lt;p&amp;gt;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.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;This does &amp;#039;&amp;#039;not&amp;#039;&amp;#039; suppress the gCLI output. Rather, it &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The returned string contains the raw HTML output.&amp;lt;/p&amp;gt;&lt;br /&gt;
|code1={{CodeSample&lt;br /&gt;
  |title=Code Samples&lt;br /&gt;
  |description=Capture the output of the &amp;lt;code&amp;gt;ashref&amp;lt;/code&amp;gt; command and save it to a file.&lt;br /&gt;
  |code=&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;d&amp;quot;&amp;gt;&lt;br /&gt;
buffer b;&lt;br /&gt;
b.append( cli_execute_output( &amp;quot;ashref&amp;quot; );&lt;br /&gt;
if ( !buffer_to_file( b, &amp;quot;ashref.txt&amp;quot; ) )&lt;br /&gt;
{&lt;br /&gt;
   abort( &amp;quot;Failed to save ashref.txt&amp;quot; );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  |moreinfo=&lt;br /&gt;
}}&lt;br /&gt;
|see_also={{SeeAlso/gCLI Functions}}&lt;br /&gt;
|cli_equiv=&lt;br /&gt;
|more_info=&lt;br /&gt;
|special=&lt;br /&gt;
|{{{1|}}}&lt;br /&gt;
}}&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
[[Category:Miscellaneous Functions]]&lt;/div&gt;</summary>
		<author><name>Philmasterplus</name></author>
	</entry>
</feed>