Difference between revisions of "Template:Cli"

From wiki.emacinc.com
Jump to: navigation, search
m (Reduced character count.)
m (Improved with new variables.)
Line 7: Line 7:
  
 
  <nowiki>{{cli | ls -la}}</nowiki>
 
  <nowiki>{{cli | ls -la}}</nowiki>
 +
 +
Choose the PWD (Present Working Directory) like this:
 +
 +
<nowiki>{{cli | ls -la | pwd=/home/user}}</nowiki>
 +
 +
Choose the hostname like this:
 +
 +
<nowiki>{{cli | ls -la | hostname=desktop}}</nowiki>
 +
 +
Choose the username like this:
 +
 +
<nowiki>{{cli | ls -la | username=developer}}</nowiki>
  
 
----
 
----
 
----
 
----
</noinclude><div style="padding-bottom:2px;padding-top:2px;padding-left:3px;padding-right:5px;background-color:#000000;">{{clitxt|#aa0000}}root{{clitxts}}{{clitxt|#ffffff}}@{{clitxts}}{{clitxt|#00aaaa}}som9x25{{clitxts}}{{clitxt|#ffffff}}:{{clitxts}}{{clitxt|#54ffff}}~{{clitxts}}{{clitxt|#ffff55}}#{{clitxts}}{{clitxt}} {{{1}}}{{clitxts}}</div>
+
</noinclude><div style="padding-bottom:2px;padding-top:2px;padding-left:3px;padding-right:5px;background-color:#000000;">{{clitxt|{{#ifeq:{{{username|}}}|{{{username|-}}}|#00aa00|#aa0000}}}}{{#ifeq:{{{username|}}}|{{{username|-}}}|{{{username}}}|root}}{{clitxts}}{{clitxt|#ffffff}}@{{clitxts}}{{clitxt|#00aaaa}}{{#ifeq:{{{hostname|}}}|{{{hostname|-}}}|{{{hostname}}}|som9x25}}{{clitxts}}{{clitxt|#ffffff}}:{{clitxts}}{{clitxt|#54ffff}}{{#ifeq:{{{pwd|}}}|{{{pwd|-}}}|{{{pwd}}}|~}}{{clitxts}}{{clitxt|#ffff55}}#{{clitxts}}{{clitxt}} {{{1}}}{{clitxts}}</div>

Revision as of 20:52, 12 November 2014

The CLI Template

This template displays the passed argument, cmd, at a simulated command line.

Use it like this:

{{cli | ls -la}}

Choose the PWD (Present Working Directory) like this:

{{cli | ls -la | pwd=/home/user}}

Choose the hostname like this:

{{cli | ls -la | hostname=desktop}}

Choose the username like this:

{{cli | ls -la | username=developer}}


root@som9x25:~# {{{1}}}