Template:GenericCmd/doc

From Gentoo Wiki
Jump to:navigation Jump to:search
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 console like color scheme for command output. It can be used to display commands, or simply the output of commands.

Parameters

Unnamed parameters (up to 10)
Add commands. Use {{=}} or {{!}} instead of the characters "=" or "|" for equal or pipe symbols, respectively.
prompt (optional)
Change the command prompt.
color (optional)
Change the prompt color.
output (optional)
Add the command's output.
collapse-output (optional)
Collapses the output so that it is only displayed when the "Expand" link is clicked (must be set to true to enable collapsed output).

Usage

See the template's testcases:


Correct

Unnamed parameter
Wiki code
{{GenericCmd|<pre>
command output
  this
    that
</pre>}}
Main version
command output
  this
    that
Sandbox version
command output
  this
    that


Multiple unnamed parameters (up to 10)
Wiki code
{{GenericCmd|command 1|command 2|command 3}}
Main version
command 1
command 2
command 3
Sandbox version
command 1
command 2
command 3


Unnamed parameter with large output
Wiki code
{{GenericCmd|ls -l /|output=<pre>
total 4
drwxr-xr-x 1 root root  970 Oct 26 22:29 bin
drwxr-xr-x 1 root root   10 Oct 26 18:29 boot
drwxr-xr-x 1 root root 1686 Oct 26 18:31 dev
drwxr-xr-x 1 root root 1276 Oct 26 22:32 etc
drwxr-xr-x 1 root root   10 Oct 26 18:29 home
lrwxrwxrwx 1 root root    5 Oct 26 21:09 lib -> lib64
drwxr-xr-x 1 root root 1366 Oct 26 21:09 lib32
drwxr-xr-x 1 root root 3490 Oct 26 22:29 lib64
drwxr-xr-x 1 root root   10 Oct 26 18:29 media
drwxr-xr-x 1 root root   10 Oct 26 18:29 mnt
drwxr-xr-x 1 root root   10 Oct 26 18:29 opt
drwxr-xr-x 1 root root    0 Oct 26 18:16 proc
drwx------ 1 root root   10 Oct 26 18:29 root
drwxr-xr-x 1 root root   22 Oct 26 22:28 run
drwxr-xr-x 1 root root 1914 Oct 26 22:32 sbin
drwxr-xr-x 1 root root   10 Oct 26 18:29 sys
drwxrwxrwt 1 root root   10 Oct 26 22:32 tmp
drwxr-xr-x 1 root root  138 Oct 26 22:32 usr
drwxr-xr-x 1 root root   66 Oct 26 18:29 var
</pre>}}
Main version
ls -l /
total 4
drwxr-xr-x 1 root root  970 Oct 26 22:29 bin
drwxr-xr-x 1 root root   10 Oct 26 18:29 boot
drwxr-xr-x 1 root root 1686 Oct 26 18:31 dev
drwxr-xr-x 1 root root 1276 Oct 26 22:32 etc
drwxr-xr-x 1 root root   10 Oct 26 18:29 home
lrwxrwxrwx 1 root root    5 Oct 26 21:09 lib -> lib64
drwxr-xr-x 1 root root 1366 Oct 26 21:09 lib32
drwxr-xr-x 1 root root 3490 Oct 26 22:29 lib64
drwxr-xr-x 1 root root   10 Oct 26 18:29 media
drwxr-xr-x 1 root root   10 Oct 26 18:29 mnt
drwxr-xr-x 1 root root   10 Oct 26 18:29 opt
drwxr-xr-x 1 root root    0 Oct 26 18:16 proc
drwx------ 1 root root   10 Oct 26 18:29 root
drwxr-xr-x 1 root root   22 Oct 26 22:28 run
drwxr-xr-x 1 root root 1914 Oct 26 22:32 sbin
drwxr-xr-x 1 root root   10 Oct 26 18:29 sys
drwxrwxrwt 1 root root   10 Oct 26 22:32 tmp
drwxr-xr-x 1 root root  138 Oct 26 22:32 usr
drwxr-xr-x 1 root root   66 Oct 26 18:29 var
Sandbox version
ls -l /
total 4
drwxr-xr-x 1 root root  970 Oct 26 22:29 bin
drwxr-xr-x 1 root root   10 Oct 26 18:29 boot
drwxr-xr-x 1 root root 1686 Oct 26 18:31 dev
drwxr-xr-x 1 root root 1276 Oct 26 22:32 etc
drwxr-xr-x 1 root root   10 Oct 26 18:29 home
lrwxrwxrwx 1 root root    5 Oct 26 21:09 lib -> lib64
drwxr-xr-x 1 root root 1366 Oct 26 21:09 lib32
drwxr-xr-x 1 root root 3490 Oct 26 22:29 lib64
drwxr-xr-x 1 root root   10 Oct 26 18:29 media
drwxr-xr-x 1 root root   10 Oct 26 18:29 mnt
drwxr-xr-x 1 root root   10 Oct 26 18:29 opt
drwxr-xr-x 1 root root    0 Oct 26 18:16 proc
drwx------ 1 root root   10 Oct 26 18:29 root
drwxr-xr-x 1 root root   22 Oct 26 22:28 run
drwxr-xr-x 1 root root 1914 Oct 26 22:32 sbin
drwxr-xr-x 1 root root   10 Oct 26 18:29 sys
drwxrwxrwt 1 root root   10 Oct 26 22:32 tmp
drwxr-xr-x 1 root root  138 Oct 26 22:32 usr
drwxr-xr-x 1 root root   66 Oct 26 18:29 var


Unnamed parameter with large output (collapsed output)
Wiki code
{{GenericCmd|ls -l /|collapse-output=true|output=<pre>
total 4
drwxr-xr-x 1 root root  970 Oct 26 22:29 bin
drwxr-xr-x 1 root root   10 Oct 26 18:29 boot
drwxr-xr-x 1 root root 1686 Oct 26 18:31 dev
drwxr-xr-x 1 root root 1276 Oct 26 22:32 etc
drwxr-xr-x 1 root root   10 Oct 26 18:29 home
lrwxrwxrwx 1 root root    5 Oct 26 21:09 lib -> lib64
drwxr-xr-x 1 root root 1366 Oct 26 21:09 lib32
drwxr-xr-x 1 root root 3490 Oct 26 22:29 lib64
drwxr-xr-x 1 root root   10 Oct 26 18:29 media
drwxr-xr-x 1 root root   10 Oct 26 18:29 mnt
drwxr-xr-x 1 root root   10 Oct 26 18:29 opt
drwxr-xr-x 1 root root    0 Oct 26 18:16 proc
drwx------ 1 root root   10 Oct 26 18:29 root
drwxr-xr-x 1 root root   22 Oct 26 22:28 run
drwxr-xr-x 1 root root 1914 Oct 26 22:32 sbin
drwxr-xr-x 1 root root   10 Oct 26 18:29 sys
drwxrwxrwt 1 root root   10 Oct 26 22:32 tmp
drwxr-xr-x 1 root root  138 Oct 26 22:32 usr
drwxr-xr-x 1 root root   66 Oct 26 18:29 var
</pre>}}
Main version
ls -l /
total 4
drwxr-xr-x 1 root root  970 Oct 26 22:29 bin
drwxr-xr-x 1 root root   10 Oct 26 18:29 boot
drwxr-xr-x 1 root root 1686 Oct 26 18:31 dev
drwxr-xr-x 1 root root 1276 Oct 26 22:32 etc
drwxr-xr-x 1 root root   10 Oct 26 18:29 home
lrwxrwxrwx 1 root root    5 Oct 26 21:09 lib -> lib64
drwxr-xr-x 1 root root 1366 Oct 26 21:09 lib32
drwxr-xr-x 1 root root 3490 Oct 26 22:29 lib64
drwxr-xr-x 1 root root   10 Oct 26 18:29 media
drwxr-xr-x 1 root root   10 Oct 26 18:29 mnt
drwxr-xr-x 1 root root   10 Oct 26 18:29 opt
drwxr-xr-x 1 root root    0 Oct 26 18:16 proc
drwx------ 1 root root   10 Oct 26 18:29 root
drwxr-xr-x 1 root root   22 Oct 26 22:28 run
drwxr-xr-x 1 root root 1914 Oct 26 22:32 sbin
drwxr-xr-x 1 root root   10 Oct 26 18:29 sys
drwxrwxrwt 1 root root   10 Oct 26 22:32 tmp
drwxr-xr-x 1 root root  138 Oct 26 22:32 usr
drwxr-xr-x 1 root root   66 Oct 26 18:29 var
Sandbox version
ls -l /
total 4
drwxr-xr-x 1 root root  970 Oct 26 22:29 bin
drwxr-xr-x 1 root root   10 Oct 26 18:29 boot
drwxr-xr-x 1 root root 1686 Oct 26 18:31 dev
drwxr-xr-x 1 root root 1276 Oct 26 22:32 etc
drwxr-xr-x 1 root root   10 Oct 26 18:29 home
lrwxrwxrwx 1 root root    5 Oct 26 21:09 lib -> lib64
drwxr-xr-x 1 root root 1366 Oct 26 21:09 lib32
drwxr-xr-x 1 root root 3490 Oct 26 22:29 lib64
drwxr-xr-x 1 root root   10 Oct 26 18:29 media
drwxr-xr-x 1 root root   10 Oct 26 18:29 mnt
drwxr-xr-x 1 root root   10 Oct 26 18:29 opt
drwxr-xr-x 1 root root    0 Oct 26 18:16 proc
drwx------ 1 root root   10 Oct 26 18:29 root
drwxr-xr-x 1 root root   22 Oct 26 22:28 run
drwxr-xr-x 1 root root 1914 Oct 26 22:32 sbin
drwxr-xr-x 1 root root   10 Oct 26 18:29 sys
drwxrwxrwt 1 root root   10 Oct 26 22:32 tmp
drwxr-xr-x 1 root root  138 Oct 26 22:32 usr
drwxr-xr-x 1 root root   66 Oct 26 18:29 var


Incorrect

No parameter (empty box)
Wiki code
{{GenericCmd}}
Main version
Sandbox version


See also