Difference between revisions of "Template:Cmd/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 user command.
 
Use this template to show a shell box with a user command.
 +
 +
== Parameters ==
 +
; Unnamed parameters (up to 10): Add commands.
 +
; prompt (optional): Change the command prompt (default: '''user $''').
 +
; color (optional): Change the prompt color (default: some green).
 +
; output (optional): Add the command's output.
  
 
== Usage ==
 
== Usage ==
For one command add this code to the page text:
+
See the template's [[Template:Cmd/testcases|testcases]]:
<pre>
+
{{Template:Cmd/testcases}}
{{Cmd|a command}}
+
</pre>
+
{{Cmd|a command}}
+
 
+
 
+
One command with output:
+
<pre>
+
{{Cmd|a command
+
|output=Some output}}
+
</pre>
+
{{Cmd|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>
+
{{Cmd|a command
+
|prompt=example ?
+
|color=blue}}
+
</pre>
+
{{Cmd|a command
+
|prompt=example ?
+
|color=blue}}
+
 
+
 
+
Up to 10 commands:
+
<pre>
+
{{Cmd|1. command
+
|2. command
+
...
+
|10. command
+
}}
+
</pre>
+
{{Cmd|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|RootCmd}}
 
* {{Tl|RootCmd}}
 +
* {{Tl|Emerge}}
  
 
<includeonly>
 
<includeonly>

Revision as of 14:42, 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 user command.

Parameters

Unnamed parameters (up to 10)
Add commands.
prompt (optional)
Change the command prompt (default: user $).
color (optional)
Change the prompt color (default: some green).
output (optional)
Add the command's output.

Usage

See the template's testcases:


Parameter: 1. unnamed
Wiki code
{{Cmd|a command}}

Main version
user $ a command

Sandbox version


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

Main version
user $ a command with = and |

Sandbox version


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

Main version
user $ a command
Some output

Sandbox version


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

Main version
example ? a command

Sandbox version


Parameter: unnamed (10x)
Wiki code
{{Cmd
|1. command
|...
|10. command
}}
</pre>

Main version
user $ 1. command
user $
2. command
user $
3. command
user $
4. command
user $
5. command
user $
6. command
user $
7. command
user $
8. command
user $
9. command
user $
10. command

Sandbox version


See also