Template:Invocation

From Gentoo Wiki
Jump to: navigation, search
[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 or fixes, or to voice your opinion.

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

Parameters

Anonymous parameter (only 1 accepted)
Add a command. Use {{=}} or {{!}} instead of the characters "=" or "|" for inline references.
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 {{Invocation|command -h}}

Main version
user $command -h
Sandbox version
user $command -h
Parameter: unnamed with the special characters "=" and "|"
Wiki code {{Invocation|command with help{{=}}true and help{{!}}false}}

Main version
user $command help=true and help|false
Sandbox version
user $command help=true and help|false
Parameter: output
Wiki code {{Invocation|command -h|output=<pre> Some output </pre>}}

Main version
user $command -h
Some output
More output
Even more output
Sandbox version
user $command -h
Some output
More output
Even more output
Parameter: prompt, color
Wiki code {{Invocation |command -h |prompt=example ? |color=lightblue }}

Main version
example ?command -h
Sandbox version
example ?command -h
Parameter: unnamed (1x)
Wiki code {{Invocation |command 1 -h }}

Main version
user $command 1 -h
Sandbox version
user $command 1 -h
Parameter: unnamed (2x)
Wiki code {{Invocation |command 1 -h |command 2 -h }}

Main version
{{Cmd}}
Parameter 2 not defined. For correct usage see template's documention.
Sandbox version
{{Cmd}}
Parameter 2 not defined. For correct usage see template's documention.

See also

  • {{Cmd}} – Template for a user prompt.
  • {{RootCmd}} – Template for a root prompt.
  • {{GenericCmd}} – White on a dark background.
  • {{Emerge}} – Quickly create an emerge style prompt by inputting the package name.
  • {{Unmerge}} – Quickly create an unmerge style prompt by inputting the package name.
Note
The above documentation is transcluded from Template:Invocation/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. (See the subpages of this template.)