Difference between revisions of "Template:RootCmd/doc"

From stoney cloud
Jump to: navigation, search
m (Extend to max. 10 lines.)
m (Rework)
Line 1: Line 1:
 
{{Template}}
 
{{Template}}
 
Use this template to show a shell box with a root command.
 
Use this template to show a shell box with a root command.
 +
 +
== Parameters ==
 +
; Unnamed parameters (up to 10): Add commands.
 +
; prompt (optional): Change the command prompt (default: '''root #''').
 +
; color (optional): Change the prompt color (default: some red).
 +
; output (optional): Add the command's output.
  
 
== Usage ==
 
== Usage ==
For one command add this code to the page text:
+
See the template's [[Template:RootCmd/testcases|testcases]]:
<pre>
+
{{Template:RootCmd/testcases}}
{{RootCmd|a command}}
+
</pre>
+
{{RootCmd|a command}}
+
 
+
 
+
One command with output:
+
<pre>
+
{{RootCmd|a command
+
|output=Some output}}
+
</pre>
+
{{RootCmd|a command
+
|output=Some output}}
+
{{Note|''output'' - as a named parameter - is optional and can additional be used in the following examples. This is also true for all following named parameters.}}
+
 
+
 
+
One command with user defined prompt and color:
+
<pre>
+
{{RootCmd|a command
+
|prompt=example ?
+
|color=blue}}
+
</pre>
+
{{RootCmd|a command
+
|prompt=example ?
+
|color=blue}}
+
 
+
 
+
Up to five commands:
+
<pre>
+
{{RootCmd|1. command
+
|2. command
+
...
+
|5. command
+
}}
+
</pre>
+
{{RootCmd|1. command
+
|2. command
+
|3. command
+
|4. command
+
|5. command
+
|6. command
+
|7. command
+
|8. command
+
|9. command
+
|10. command
+
}}
+
  
 
== See also ==
 
== See also ==
 +
* {{Tl|GenericCmd}}
 
* {{Tl|Cmd}}
 
* {{Tl|Cmd}}
 +
* {{Tl|Emerge}}
  
 
<includeonly>
 
<includeonly>

Revision as of 17:26, 23 August 2012

Note
This page is a template. It contains some standardized, often used text, which can be transcluded inside other pages.

As this template is widely used in our wiki, it may be protected in which case only staff members can change it. Use the discussion page to propose enhancements, fixes or voice your opinion.

Use this template to show a shell box with a root command.

Parameters

Unnamed parameters (up to 10)
Add commands.
prompt (optional)
Change the command prompt (default: root #).
color (optional)
Change the prompt color (default: some red).
output (optional)
Add the command's output.

Usage

See the template's testcases:


Parameter: unnamed
Wiki code
{{RootCmd|a command}}

Main version
root # a command

Sandbox version


Parameter: unnamed with the special characters "=" and "|"
Wiki code
{{RootCmd|a command with {{=}} and {{!}}}}

Main version
root # a command with = and |

Sandbox version


Parameter: output
Wiki code
{{RootCmd|a command|output=<pre>
Some output
</pre>}}

Main version
root # a command
Some output

Sandbox version


Parameter: prompt, color
Wiki code
{{RootCmd
|a command
|prompt=example ?
|color=blue
}}

Main version
example ? a command

Sandbox version


Parameter: unnamed (10x)
Wiki code
{{RootCmd
|1. command
|...
|10. command
}}

Main version
root # 1. command
root #
2. command
root #
3. command
root #
4. command
root #
5. command
root #
6. command
root #
7. command
root #
8. command
root #
9. command
root #
10. command

Sandbox version


See also