Modèle:Command : Différence entre versions

De ArchwikiFR
m
m
 
Ligne 33 : Ligne 33 :
 
Long lines will automatically wrap.
 
Long lines will automatically wrap.
 
</noinclude><includeonly><div style="padding: 0.5em; line-height: 1.1; background-color: #333; color: #eee; border: 1px solid #08c"><code style="color: white; background: transparent; white-space: pre-wrap; overflow-x: auto">{{{prompt|$}}} {{{command|{{{name|{{{1|undefined}}}}}}}}}</code></div>
 
</noinclude><includeonly><div style="padding: 0.5em; line-height: 1.1; background-color: #333; color: #eee; border: 1px solid #08c"><code style="color: white; background: transparent; white-space: pre-wrap; overflow-x: auto">{{{prompt|$}}} {{{command|{{{name|{{{1|undefined}}}}}}}}}</code></div>
<pre style="white-space: pre-wrap; overflow-x: auto; border-top: none; margin-top: 0">{{{output|{{{2|undefined}}}}}}</pre></includeonly>
+
<pre<includeonly> style="white-space: pre-wrap; overflow-x: auto; border-top: none; margin-top: 0">{{{output|{{{2|undefined}}}}}}</pre></includeonly>

Version actuelle datée du 26 avril 2014 à 22:07

Cette page est un modèle, pour plus d'informations, lire Aide:Modèle

A 'Command' box used to display command output.

This template accepts both named and unnamed parameters.

{{Command|name=command name|output=command output}}
$ command name
command output
{{Command|command=command name|output=command output}}
$ command name
command output
{{Command|command name|command output}}
$ command name
command output

An optional prompt argument can be used to specify an alternative prompt. The default prompt is $, indicating that the command should be run as an unprivileged user. To specify that a command should be run as root, use # as the prompt:

{{Command|privileged command name|privileged command output|prompt=#}}
# privileged command name
privileged command output

This template can be used for any interactive shell. For example, an interactive Python session:

{{Command|import this|The Zen of Python, by Tim Peters|prompt=>>>}}
>>> import this
The Zen of Python, by Tim Peters

Note that parameters containing equals signs and wiki markup should be surrounded by <nowiki> tags.

Long lines will automatically wrap.