Difference between revisions of "Template:Cmd"

From stoney cloud
Jump to: navigation, search
m (14 revisions from gentoo-wiki:Template:Cmd: import from wiki.gentoo.org)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<div style="border: 1px solid #8981AA; background-color: #F6F6F6; padding: .3em; margin-top: .4em; margin-bottom: .4em; font-family: monospace"><code><span style="color: #4e9a06; font-weight: bold;"> user $</span> {{{1}}}</code></div>
+
<includeonly>{{#if: {{{1|}}}
 +
|{{#if: {{{11|}}}
 +
  |{{Error|Cmd|11}}
 +
|{{GenericCmd|{{{1}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|{{{5|}}}|{{{6|}}}|{{{7|}}}|{{{8|}}}|{{{9|}}}|{{{10|}}}|{{{11|}}}|prompt={{{prompt|user $}}}|color={{{color|#4E9A06}}}|output={{{output|}}}}}
 +
}}
 +
|{{Error|Cmd|unnamed}}
 +
}}</includeonly><noinclude>
 +
{{Documentation}}
 +
</noinclude>

Latest revision as of 08:55, 22 August 2014

[edit Documentation
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. Use {{=}} or {{!}} instead of the characters "=" or "|".
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

Note
The above documentation is transcluded from Template:Cmd/doc. (edit | history)
Editors can experiment in this template's sandbox (edit) and testcases (edit) pages.
Please add categories and interwikis to the /doc subpage. Subpages of this template.