- Recommend using the same name for script itself,
${name}, PROVIDE, and rc.conf var prefix.
- Distinguish flags from options when telling why -foo
doesn't belong in $command_args. ${name}_flags can
contain both dashed options and arguments, so saying
"flags" when I mean options was confusing.
Suggested by: dougb
This commit is contained in:
parent
d5b45016fd
commit
d3b1240703
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=28946
1 changed files with 33 additions and 5 deletions
|
|
@ -662,11 +662,17 @@ run_rc_command "$1"</programlisting>
|
|||
can be specified in <envar>command_args</envar>.</para>
|
||||
|
||||
<note>
|
||||
<para>It would be a poor idea to include flags in
|
||||
<envar>command_args</envar> because most commands cannot
|
||||
accept flags and ordinary arguments interleaved. A
|
||||
better way of passing additional flags is to add them
|
||||
to the beginning of <envar>mumbled_flags</envar>.
|
||||
<para><emphasis>Never</emphasis> include dashed options,
|
||||
like <option>-X</option> or <option>--foo</option>, in
|
||||
<envar>command_args</envar>.
|
||||
The contents of <envar>command_args</envar> will
|
||||
appear at the end of the final command line, hence
|
||||
they are likely to follow arguments present in
|
||||
<envar>${name}_flags</envar>; but most commands will
|
||||
not recognize dashed options after ordinary arguments.
|
||||
A better way of passing additional options
|
||||
to <envar>$command</envar> is to add them
|
||||
to the beginning of <envar>${name}_flags</envar>.
|
||||
Another way is to modify <envar>rc_flags</envar> <link
|
||||
linkend="rc-flags">as shown later</link>.</para>
|
||||
</note>
|
||||
|
|
@ -1012,6 +1018,28 @@ run_rc_command "$1"</programlisting>
|
|||
provided. However, nothing prevents us from listing
|
||||
several conditions there, e.g., for compatibility
|
||||
reasons.</para>
|
||||
|
||||
<para>The best style is to use the same name for the
|
||||
following entities:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>the script's file;</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>its main <literal>PROVIDE:</literal> condition;</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>its <envar>${name}</envar>;</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>the prefix of its &man.rc.conf.5; variables,
|
||||
as well as of its private variables and functions.</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</note>
|
||||
</callout>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue