All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] setterm: documentation updates
@ 2014-05-24 11:08 Sami Kerola
  2014-05-24 11:08 ` [PATCH 1/4] setterm: add usage() descriptions Sami Kerola
                   ` (3 more replies)
  0 siblings, 4 replies; 26+ messages in thread
From: Sami Kerola @ 2014-05-24 11:08 UTC (permalink / raw)
  To: util-linux; +Cc: kerolasa

On 20 May 2014 11:02, Karel Zak <kzak@redhat.com> wrote:
>  BTW, setterm still need our love:

Hi Karel and others,

Here is the remaining setterm(1) love before release 2.25. 

>   * usage() contains only options, but no any description

In this patch set, see 0001.

>   * it would be nice to have long options (--term rather than -term)
>     in the man page

Hold on, do you mean what I did in commit
fb27f91cac9702ad1858d782dd840d5868547423

>   * nowhere (in man page) is info that --long options are supported
>     since v2.25 (and for backward compatibility is better to use
>     "-foo" rather than "--foo")

In this patch set, see 0003.


Sami Kerola (4):
  setterm: add usage() descriptions
  docs: setterm.1 add missing options to manual page and remove
    duplicate
  docs: setterm.1 add options compatibility note
  docs: setterm.1 clean up manual page groff style

 term-utils/setterm.1 | 291 +++++++++++++++++++++++++++++++++------------------
 term-utils/setterm.c |  69 ++++++------
 2 files changed, 222 insertions(+), 138 deletions(-)

-- 
1.9.3


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH 1/4] setterm: add usage() descriptions
  2014-05-24 11:08 [PATCH 0/4] setterm: documentation updates Sami Kerola
@ 2014-05-24 11:08 ` Sami Kerola
  2014-05-24 12:30   ` Benno Schulenberg
  2014-05-24 11:08 ` [PATCH 2/4] docs: setterm.1 add missing options to manual page and remove duplicate Sami Kerola
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 26+ messages in thread
From: Sami Kerola @ 2014-05-24 11:08 UTC (permalink / raw)
  To: util-linux; +Cc: kerolasa

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 term-utils/setterm.c | 69 ++++++++++++++++++++++++++--------------------------
 1 file changed, 35 insertions(+), 34 deletions(-)

diff --git a/term-utils/setterm.c b/term-utils/setterm.c
index 5f59a8b..936892a 100644
--- a/term-utils/setterm.c
+++ b/term-utils/setterm.c
@@ -402,40 +402,41 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
 	fprintf(out,
 	      _(" %s [options]\n"), program_invocation_short_name);
 	fputs(USAGE_OPTIONS, out);
-	fputs(_(" --term <terminal_name>\n"), out);
-	fputs(_(" --reset\n"), out);
-	fputs(_(" --initialize\n"), out);
-	fputs(_(" --cursor <on|off>\n"), out);
-	fputs(_(" --repeat <on|off>\n"), out);
-	fputs(_(" --appcursorkeys <on|off>\n"), out);
-	fputs(_(" --linewrap <on|off>\n"), out);
-	fputs(_(" --default\n"), out);
-	fputs(_(" --foreground <default|color>\n"), out);
-	fputs(_(" --background <default|color>\n"), out);
-	fputs(_(" --ulcolor [bright] <color>\n"), out);
-	fputs(_(" --hbcolor [bright] <color>\n"), out);
-	fputs(_(" <color>: black blue cyan green grey magenta red white yellow\n"), out);
-	fputs(_(" --inversescreen <on|off>\n"), out);
-	fputs(_(" --bold <on|off>\n"), out);
-	fputs(_(" --half-bright <on|off>\n"), out);
-	fputs(_(" --blink <on|off>\n"), out);
-	fputs(_(" --reverse <on|off>\n"), out);
-	fputs(_(" --underline <on|off>\n"), out);
-	fputs(_(" --store\n"), out);
-	fputs(_(" --clear <all|rest>\n"), out);
-	fputs(_(" --tabs <tab1 tab2 tab3 ...>      (tabn = 1-160)\n"), out);
-	fputs(_(" --clrtabs <tab1 tab2 tab3 ...>   (tabn = 1-160)\n"), out);
-	fputs(_(" --regtabs <1-160>\n"), out);
-	fputs(_(" --blank <0-60|force|poke>\n"), out);
-	fputs(_(" --dump   <1-NR_CONSOLES>\n"), out);
-	fputs(_(" --append <1-NR_CONSOLES>\n"), out);
-	fputs(_(" --file dumpfilename\n"), out);
-	fputs(_(" --msg <on|off>\n"), out);
-	fputs(_(" --msglevel <0-8>\n"), out);
-	fputs(_(" --powersave <on|vsync|hsync|powerdown|off>\n"), out);
-	fputs(_(" --powerdown <0-60>\n"), out);
-	fputs(_(" --blength <0-2000>\n"), out);
-	fputs(_(" --bfreq freqnumber\n"), out);
+	fputs(_(" --term          <terminal_name>   override TERM environment variable\n"), out);
+	fputs(_(" --reset                           reset terminal to power on state\n"), out);
+	fputs(_(" --initialize                      display init string, and use default settings\n"), out);
+	fputs(_(" --default                         use default terminal settings\n"), out);
+	fputs(_(" --store                           save current terminal settings as default\n"), out);
+	fputs(_(" --cursor        <on|off>          display cursor\n"), out);
+	fputs(_(" --repeat        <on|off>          keyboard repeat\n"), out);
+	fputs(_(" --appcursorkeys <on|off>          cursor key application mode\n"), out);
+	fputs(_(" --linewrap      <on|off>          continue on a new line when a line is full\n"), out);
+	fputs(_(" --inversescreen <on|off>          inverse foreground and background colors\n"), out);
+	fputs(_(" --foreground    <default|color>   set foreground color\n"), out);
+	fputs(_(" --background    <default|color>   set background color\n"), out);
+	fputs(_(" --ulcolor       [bright] <color>  set underlined text color\n"), out);
+	fputs(_(" --hbcolor       [bright] <color>  set bold text color\n"), out);
+	fputs(_("                 <color>: black blue cyan green grey magenta red white yellow\n"), out);
+	fputs(_(" --bold          <on|off>          bold\n"), out);
+	fputs(_(" --half-bright   <on|off>          dim\n"), out);
+	fputs(_(" --blink         <on|off>          blink\n"), out);
+	fputs(_(" --underline     <on|off>          underline\n"), out);
+	fputs(_(" --reverse       <on|off>          reverse all output options\n"), out);
+	fputs(_(" --clear         <all|rest>        clear screen and set cursor position\n"), out);
+	fputs(_(" --tabs          <number ...>      set tab stop positions\n"), out);
+	fputs(_(" --clrtabs       <number ...>      clear tab stop positions\n"), out);
+	fputs(_(" --regtabs       <1-160>           set default tab stop position\n"), out);
+	fputs(_(" --blank         <0-60|force|poke> set inactivity interval\n"), out);
+	fputs(_(" --dump          <number>          write vcsa<number> console dump to file\n"), out);
+	fputs(_(" --append        <number>          append vcsa<number> console dump\n"), out);
+	fputs(_(" --file          <file>            path to vcsa<number> dump file\n"), out);
+	fputs(_(" --msg           <on|off>          kernel messages to console\n"), out);
+	fputs(_(" --msglevel      <0-8>             kernel console log level\n"), out);
+	fputs(_(" --powersave     <on|vsync|hsync|powerdown|off>\n"), out);
+	fputs(_("                                   set vesa powersaving features\n"), out);
+	fputs(_(" --powerdown     <0-60>            set vesa powerdown interval in minutes\n"), out);
+	fputs(_(" --blength       <0-2000>          duration of the bell in milliseconds\n"), out);
+	fputs(_(" --bfreq         freqnumber        bell frequency in Hertz\n"), out);
 	fputs(_(" --version\n"), out);
 	fputs(_(" --help\n"), out);
 	fprintf(out, USAGE_MAN_TAIL("setterm(1)"));
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 2/4] docs: setterm.1 add missing options to manual page and remove duplicate
  2014-05-24 11:08 [PATCH 0/4] setterm: documentation updates Sami Kerola
  2014-05-24 11:08 ` [PATCH 1/4] setterm: add usage() descriptions Sami Kerola
@ 2014-05-24 11:08 ` Sami Kerola
  2014-05-24 12:33   ` Benno Schulenberg
  2014-05-24 11:08 ` [PATCH 3/4] docs: setterm.1 add options compatibility note Sami Kerola
  2014-05-24 11:08 ` [PATCH 4/4] docs: setterm.1 clean up manual page groff style Sami Kerola
  3 siblings, 1 reply; 26+ messages in thread
From: Sami Kerola @ 2014-05-24 11:08 UTC (permalink / raw)
  To: util-linux; +Cc: kerolasa

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 term-utils/setterm.1 | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/term-utils/setterm.1 b/term-utils/setterm.1
index d15fd40..5b843dc 100644
--- a/term-utils/setterm.1
+++ b/term-utils/setterm.1
@@ -52,6 +52,9 @@ cause problems for vi users.
 Like \fB\-\-dump\fP, but appends to the snapshot file instead of overwriting
 it.  Only works if no \fB\-\-dump\fP options are given.
 .TP
+\fB\-\-foreground\fP \fI8-color\fP|\fBdefault\fP (virtual consoles only)
+Sets the foreground text color.
+.TP
 \fB\-\-background\fP \fI8-color\fP|\fBdefault\fP (virtual consoles only)
 Sets the background text color.
 .TP
@@ -106,16 +109,25 @@ specified in the \fB\-\-file\fP option, overwriting its contents; the default
 is screen.dump.  Without an argument, dumps the current virtual console.
 Overrides \fB\-\-append\fP.
 .TP
-.BR \-\-append " [\fI1-NR_CONS\fP]"
-Like \fB\-\-dump\fP, but appends to the snapshot file instead of overwriting
-it.  Only works if no \fB\-\-dump\fP options are given.
-.TP
 .BI \-\-file " dumpfilename"
 Sets the snapshot file name for any \fB\-\-dump\fP or \fB\-\-append\fP options
 on the same command line.  If this option is not present, the default is
 screen.dump in the current directory.  A path name that exceeds system
 maximum will be truncated, see PATH_MAX from linux/limits.h for the value.
 .TP
+\fB\-\-hbcolor\fP \fI16-color\fP (virtual consoles only)
+Sets the color for bold characters.
+.TP
+.B \-\-initialize
+Displays the terminal initialization string, which typically sets the
+terminal's rendering options, and other attributes to the default values.
+.TP
+.BR \-\-inversescreen " [" on | off "]"
+Invert foreground and background color.
+.TP
+.BR \-\-linewrap " [" on | off "]"
+Continue on a new line when a line is full.
+.TP
 .BR \-\-msg " [" on | off "] (virtual consoles only)"
 Enables or disables the sending of kernel \fBprintk()\fP messages to the
 console.
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 3/4] docs: setterm.1 add options compatibility note
  2014-05-24 11:08 [PATCH 0/4] setterm: documentation updates Sami Kerola
  2014-05-24 11:08 ` [PATCH 1/4] setterm: add usage() descriptions Sami Kerola
  2014-05-24 11:08 ` [PATCH 2/4] docs: setterm.1 add missing options to manual page and remove duplicate Sami Kerola
@ 2014-05-24 11:08 ` Sami Kerola
  2014-05-24 12:38   ` Benno Schulenberg
  2014-05-24 11:08 ` [PATCH 4/4] docs: setterm.1 clean up manual page groff style Sami Kerola
  3 siblings, 1 reply; 26+ messages in thread
From: Sami Kerola @ 2014-05-24 11:08 UTC (permalink / raw)
  To: util-linux; +Cc: kerolasa

Both --option and -option formats are accepted.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 term-utils/setterm.1 | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/term-utils/setterm.1 b/term-utils/setterm.1
index 5b843dc..995e1c9 100644
--- a/term-utils/setterm.1
+++ b/term-utils/setterm.1
@@ -8,7 +8,7 @@
 .\" Undocumented: -snow, -softscroll, -standout; these are
 .\" commented out in the source
 .\"
-.TH SETTERM 1 "January 2000" "util-linux" "User Commands"
+.TH SETTERM 1 "May 2014" "util-linux" "User Commands"
 .SH NAME
 setterm \- set terminal attributes
 .SH SYNOPSIS
@@ -196,6 +196,16 @@ Display version information and exit.
 .TP
 .BR \-\-help
 Display help text and exit.
+.SH COMPATIBILITY
+Since version 2.25 the
+.B setterm
+has supported long options with two hyphens, for example
+.BR \-\-help ,
+aside with single hyphen options, for example
+.BR \-help .
+In scripts it is better to use backward compatibile single hyphen rather
+than two hyphens.  Currently there are no plans or good reasons to
+discontinue single hyphen compatibility.
 .SH "SEE ALSO"
 .BR tput (1),
 .BR stty (1),
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH 4/4] docs: setterm.1 clean up manual page groff style
  2014-05-24 11:08 [PATCH 0/4] setterm: documentation updates Sami Kerola
                   ` (2 preceding siblings ...)
  2014-05-24 11:08 ` [PATCH 3/4] docs: setterm.1 add options compatibility note Sami Kerola
@ 2014-05-24 11:08 ` Sami Kerola
  2014-05-24 12:44   ` Benno Schulenberg
  3 siblings, 1 reply; 26+ messages in thread
From: Sami Kerola @ 2014-05-24 11:08 UTC (permalink / raw)
  To: util-linux; +Cc: kerolasa

Underline option arguments, and use bold for options.  Avoid use of \f
font style change in paragraphs, but use them when describing options.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 term-utils/setterm.1 | 265 +++++++++++++++++++++++++++++++--------------------
 1 file changed, 163 insertions(+), 102 deletions(-)

diff --git a/term-utils/setterm.1 b/term-utils/setterm.1
index 995e1c9..b3c8d6a 100644
--- a/term-utils/setterm.1
+++ b/term-utils/setterm.1
@@ -1,4 +1,4 @@
-\" Copyright 1990 Gordon Irlam (gordoni@cs.ua.oz.au)
+.\" Copyright 1990 Gordon Irlam (gordoni@cs.ua.oz.au)
 .\" Copyright 1992 Rickard E. Faith (faith@cs.unc.edu)
 .\" Most of this was copied from the source code.
 .\" Do not restrict distribution.
@@ -16,185 +16,244 @@ setterm \- set terminal attributes
 .RI [ options ]
 .SH DESCRIPTION
 .B setterm
-writes to standard output a character string that will invoke the
-specified terminal capabilities.  Where possible
+writes to standard output a character string that will invoke the specified
+terminal capabilities.  Where possible
 .I terminfo
-is consulted to find the string to use.  Some options however (marked
-"virtual consoles only" below) do not correspond to a
+is consulted to find the string to use.  Some options however (marked "virtual
+consoles only" below) do not correspond to a
 .BR terminfo (5)
-capability.  In this case, if the terminal type is "con" or "linux" the
-string that invokes the specified capabilities on the PC Minix virtual
-console driver is output.  Options that are not implemented by the terminal
-are ignored.
+capability.  In this case, if the terminal type is "con" or "linux" the string
+that invokes the specified capabilities on the PC Minix virtual console driver
+is output.  Options that are not implemented by the terminal are ignored.
 .SH OPTIONS
-For boolean options (\fBon\fP or \fBoff\fP), the default is \fBon\fP.
+For boolean options
+.RI ( on
+or
+.IR off ),
+the default is
+.IR on .
 .P
-For conciseness, an \fI8-color\fP below is \fBblack\fP, \fBred\fP,
-\fBgreen\fP, \fByellow\fP, \fBblue\fP, \fBmagenta\fP, \fBcyan\fP, or
-\fBwhite\fP.
+For conciseness, an
+.I 8-color
+below is
+.IR  black ,
+.IR  red ,
+.IR green ,
+.IR yellow ,
+.IR blue ,
+.IR magenta ,
+.IR cyan ,
+or
+.IR white .
 .P
-A \fI16-color\fP is an \fI8-color\fP, \fBgrey\fP, or \fBbright\fP followed
-by \fBred\fP, \fBgreen\fP, \fByellow\fP, \fBblue\fP, \fBmagenta\fP,
-\fBcyan\fP, or \fBwhite\fP.
+A
+.I 16-color
+is an
+.IR 8-color ,
+.IR grey ,
+or
+.IR bright
+followed
+by
+.IR red ,
+.IR green ,
+.IR yellow ,
+.IR blue ,
+.IR magenta ,
+.IR cyan ,
+or
+.IR white .
 .P
 The various color options may be set independently, at least at virtual
 consoles, though the results of setting multiple modes (for example,
-.BR \-\-underline " and " \-\-half-bright )
+.B \-\-underline
+and
+.BR \-\-half-bright )
 are hardware-dependent.
 .TP
-.BR \-\-appcursorkeys " [" on | off "] (virtual consoles only)"
-Sets Cursor Key Application Mode on or off. When on, ESC O A, ESC O B, etc.
+\fB\-\-appcursorkeys\fP \fIon\fP|\fIoff\fP (virtual consoles only)
+Sets Cursor Key Application Mode on or off.  When on, ESC O A, ESC O B, etc.
 will be sent for the cursor keys instead of ESC [ A, ESC [ B, etc.  See the
-"vi and Cursor-Keys" section of the Text-Terminal-HOWTO for how this can
-cause problems for vi users.
-.TP
-.BR \-\-append " [\fI1-NR_CONS\fP]"
-Like \fB\-\-dump\fP, but appends to the snapshot file instead of overwriting
-it.  Only works if no \fB\-\-dump\fP options are given.
-.TP
-\fB\-\-foreground\fP \fI8-color\fP|\fBdefault\fP (virtual consoles only)
+.I vi and Cursor-Keys
+section of the
+.I Text-Terminal-HOWTO
+for how this can cause problems for vi users.
+.TP
+\fB\-\-append\fP [\fI1-NR_CONS\fP]
+Like
+.BR \-\-dump ,
+but appends to the snapshot file instead of overwriting it.  Only works if no
+.B \-\-dump
+options are given.
+.TP
+\fB\-\-foreground\fP \fI8-color\fP|\fIdefault\fP (virtual consoles only)
 Sets the foreground text color.
 .TP
-\fB\-\-background\fP \fI8-color\fP|\fBdefault\fP (virtual consoles only)
+\fB\-\-background\fP \fI8-color\fP|\fIdefault\fP (virtual consoles only)
 Sets the background text color.
 .TP
-.BR \-\-blank " [\fI0-60\fP|\fBforce\fP|\fBpoke\fP] (virtual consoles only)"
+\fB\-\-blank\fP [\fI0-60\fP|\fIforce\fP|\fIpoke\fP] (virtual consoles only)
 Sets the interval of inactivity, in minutes, after which the screen will be
 automatically blanked (using APM if available).  Without an argument, gets the
 blank status (returns which vt was blanked or zero for unblanked vt).
-
+.IP
 The
-.B force
+.I force
 option keeps screen blank even if a key is pressed.
-
+.IP
 The
-.B poke
+.I poke
 option unblank the screen.
 .TP
-.BR \-\-bfreq " [\fIfreqnumber\fP]"
-Sets the bell frequency in Hz.  Without an argument, defaults to 0.
+\fB\-\-bfreq\fP [\fIfreqnumber\fP]
+Sets the bell frequency in Hertz.  Without an argument, defaults to
+.IR 0 .
 .TP
-.BR \-\-blength " [\fI0-2000\fP]"
-Sets the bell duration in milliseconds.  Without an argument, defaults to 0.
+\fB\-\-blength\fP [\fI0-2000\fP]
+Sets the bell duration in milliseconds.  Without an argument, defaults to
+.IR 0 .
 .TP
-.BR \-\-blink " [" on | off ]
-Turns blink mode on or off.  Except at a virtual console, \fB\-\-blink off\fP
+\fB\-\-blink\fP \fIon\fP|\fIoff\fP
+Turns blink mode on or off.  Except at a virtual console,
+.B \-\-blink off
 turns off all attributes (bold, half-brightness, blink, reverse).
 .TP
-.BR \-\-bold " [" on | off ]
-Turns bold (extra bright) mode on or off.  Except at a virtual console,
-\fB\-\-bold off\fP turns off all attributes (bold, half-brightness, blink,
-reverse).
-.TP
-.BR \-\-clear " [" all ]
-Clears the screen and "homes" the cursor, as
-.BR clear (1).
+\fB\-\-bold\fP \fIon\fP|\fIoff\fP
+Turns bold (extra bright) mode on or off. Except at a virtual console,
+.B \-\-bold off
+turns off all attributes (bold, half-brightness, blink, reverse).
 .TP
-.B \-\-clear rest
-Clears from the current cursor position to the end of the screen.
+\fB\-\-clear\fP \fIall\fP|\fIrest\fP
+With argument
+.I all
+the cursor is set to home position, and all output is removed from screen,
+.BR clear (1)
+does.  The argument
+.I rest
+clears from the current cursor position to the end of the screen.
 .TP
-.BR \-\-clrtabs " [\fItab1 tab2 tab3\fP ...] (virtual consoles only)"
+\fB\-\-clrtabs\fP [\fItab1 tab2 tab3\fP ...] (virtual consoles only)
 Clears tab stops from the given horizontal cursor positions, in the range
-1-160.  Without arguments, clears all tab stops.
+.IR 1-160 .
+Without arguments, clears all tab stops.
 .TP
-.BR \-\-cursor " [" on | off ]
+\fB\-\-cursor\fP \fIon\fP|\fIoff\fP
 Turns the terminal's cursor on or off.
 .TP
-.B \-\-default
+\fB\-\-default\fP
 Sets the terminal's rendering options to the default values.
 .TP
-.BR \-\-dump " [\fI1-NR_CONS\fP]"
-Writes a snapshot of the given virtual console to the file
-specified in the \fB\-\-file\fP option, overwriting its contents; the default
-is screen.dump.  Without an argument, dumps the current virtual console.
-Overrides \fB\-\-append\fP.
-.TP
-.BI \-\-file " dumpfilename"
-Sets the snapshot file name for any \fB\-\-dump\fP or \fB\-\-append\fP options
-on the same command line.  If this option is not present, the default is
-screen.dump in the current directory.  A path name that exceeds system
-maximum will be truncated, see PATH_MAX from linux/limits.h for the value.
+\fB\-\-dump\fP [\fI1-NR_CONS\fP]
+Writes a snapshot of the given virtual console to the file specified in the
+.B \-\-file
+option, overwriting its contents; the default is
+.IR screen.dump .
+Without an argument, dumps the current virtual console.  Overrides
+.BR \-\-append .
+.TP
+\fB\-\-file\fP \fIdumpfilename\fP
+Sets the snapshot file name for any
+.B \-\-dump
+or
+.B \-\-append
+options on the same command line.  If this option is not present, the default
+is
+.I screen.dump
+in the current directory.  A path name that exceeds system maximum will be
+truncated, see PATH_MAX from linux/limits.h for the value.
 .TP
 \fB\-\-hbcolor\fP \fI16-color\fP (virtual consoles only)
 Sets the color for bold characters.
 .TP
-.B \-\-initialize
+\fB\-\-initialize\fP
 Displays the terminal initialization string, which typically sets the
 terminal's rendering options, and other attributes to the default values.
 .TP
-.BR \-\-inversescreen " [" on | off "]"
+\fB\-\-inversescreen\fP \fIon\fP|\fIoff\fP
 Invert foreground and background color.
 .TP
-.BR \-\-linewrap " [" on | off "]"
+\fB\-\-linewrap\fP \fIon\fP|\fIoff\fP
 Continue on a new line when a line is full.
 .TP
-.BR \-\-msg " [" on | off "] (virtual consoles only)"
-Enables or disables the sending of kernel \fBprintk()\fP messages to the
-console.
-.TP
-.BR \-\-msglevel " \fI1-8\fP (virtual consoles only)"
-Sets the console logging level for kernel \fBprintk()\fP messages.  All
-messages strictly more important than this will be printed, so a logging
-level of 0 has the same effect as \fB\-\-msg on\fP and a logging level of 8
+\fB\-\-msg\fP \fIon\fP|\fIoff\fP (virtual consoles only)
+Enables or disables the sending of kernel
+.BR printk()
+messages to the console.
+.TP
+\fB\-\-msglevel\fP \fI0-8\fP (virtual consoles only)
+Sets the console logging level for kernel
+.B printk()
+messages.  All messages strictly more important than this will be printed, so a
+logging level of
+.I 0
+has the same effect as
+.B \-\-msg on
+and a logging level of
+.I 8
 will print all kernel messages.
 .BR klogd (8)
 may be a more convenient interface to the logging of kernel messages.
 .TP
-.BR \-\-powerdown " [\fI0-60\fP]"
+\fB\-\-powerdown\fP [\fI0-60\fP]
 Sets the VESA powerdown interval in minutes.  Without an argument, defaults
-to 0 (disable powerdown).  If the console is blanked or the monitor is in
-suspend mode, then the monitor will go into vsync suspend mode or powerdown
-mode respectively after this period of time has elapsed.
+to
+.I 0
+(disable powerdown).  If the console is blanked or the monitor is in suspend
+mode, then the monitor will go into vsync suspend mode or powerdown mode
+respectively after this period of time has elapsed.
 .TP
-.BR \-\-underline " [" on | off ]
-Turns underline mode on or off (see \fB\-\-ulcolor\fP).
+\fB\-\-underline\fP \fIon\fP|\fIoff\fP
+Turns underline mode on or off (see
+.BR \-\-ulcolor .
 .TP
-.BR \-\-powersave " [" off "]"
+\fB\-\-powersave\fP \fIoff\fP
 Turns off monitor VESA powersaving features.
 .TP
-.BR "\-\-powersave on" | vsync
+\fB\-\-powersave\fP \fIon\fP|\fIvsync\fP
 Puts the monitor into VESA vsync suspend mode.
 .TP
-.B \-\-powersave powerdown
+\fB\-\-powersave\fP \fIpowerdown\fP
 Puts the monitor into VESA powerdown mode.
 .TP
-.B \-\-powersave hsync
+\fB\-\-powersave\fP \fIhsync\fP
 Puts the monitor into VESA hsync suspend mode.
 .TP
-.BR \-\-regtabs " [\fI1-160\fP] (virtual consoles only)"
-Clears all tab stops, then sets a regular tab stop pattern, with one tab
-every specified number of positions.  Without an argument, defaults to 8.
+\fB\-\-regtabs\fP [\fI1-160\fP] (virtual consoles only)
+Clears all tab stops, then sets a regular tab stop pattern, with one tab every
+specified number of positions.  Without an argument, defaults to
+.IR 8 .
 .TP
-.BR \-\-repeat " [" on | off "] (virtual consoles only)"
+\fB\-\-repeat\fP \fIon\fP|\fIoff\fP (virtual consoles only)
 Turns keyboard repeat on or off.
 .TP
-.B \-\-reset
+\fB\-\-reset\fP
 Displays the terminal reset string, which typically resets the terminal to
 its power on state.
 .TP
-.BR \-\-reverse " [" on | off ]
+\fB\-\-reverse\fP \fIon\fP|\fIoff\fP
 Turns reverse video mode on or off.  Except at a virtual console,
-\fB\-\-reverse off\fP turns off all attributes (bold, half-brightness, blink,
-reverse).
+.B \-\-reverse off
+turns off all attributes (bold, half-brightness, blink, reverse).
 .TP
-.BR \-\-store " (virtual consoles only)"
-Stores the terminal's current rendering options (foreground and
-background colors) as the values to be used at reset-to-default.
+\fB\-\-store\fP (virtual consoles only)
+Stores the terminal's current rendering options (foreground and background
+colors) as the values to be used at reset-to-default.
 .TP
-.BR \-\-tabs " [\fItab1 tab2 tab3\fP ...] (virtual consoles only)"
-Sets tab stops at the given horizontal cursor positions, in the range 1-160.
+\fB\-\-tabs\fP [\fItab1 tab2 tab3\fP ...] (virtual consoles only)
+Sets tab stops at the given horizontal cursor positions, in the range
+.IR 1-160 .
 Without arguments, shows the current tab stop settings.
 .TP
-.BR \-\-term " terminal_name"
+\fB\-\-term\fP \fIterminal_name\fP
 Overrides the TERM environment variable.
 .TP
 \fB\-\-ulcolor\fP \fI16-color\fP (virtual consoles only)
 Sets the color for underlined characters.
 .TP
-.BR \-\-version
+\fB\-\-version\fP
 Display version information and exit.
 .TP
-.BR \-\-help
+\fB\-\-help\fP
 Display help text and exit.
 .SH COMPATIBILITY
 Since version 2.25 the
@@ -215,4 +274,6 @@ discontinue single hyphen compatibility.
 Differences between the Minix and Linux versions are not documented.
 .SH AVAILABILITY
 The setterm command is part of the util-linux package and is available from
-ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
+.UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
+Linux Kernel Archive
+.UE .
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/4] setterm: add usage() descriptions
  2014-05-24 11:08 ` [PATCH 1/4] setterm: add usage() descriptions Sami Kerola
@ 2014-05-24 12:30   ` Benno Schulenberg
  2014-05-25 10:57     ` Sami Kerola
  0 siblings, 1 reply; 26+ messages in thread
From: Benno Schulenberg @ 2014-05-24 12:30 UTC (permalink / raw)
  To: Sami Kerola; +Cc: Util-Linux


Hi Sami,

On Sat, May 24, 2014, at 13:08, Sami Kerola wrote:
> +	fputs(_(" --inversescreen <on|off>          inverse foreground and background colors\n"), out);

s/inverse/swap/
s/colors/colors for the whole screen/

And all these <on|off> should be [on|off], like in the man page,
as they are literal arguments and optional.

> +	fputs(_(" --foreground    <default|color>   set foreground color\n"), out);

default|<color>

> +	fputs(_(" --reverse       <on|off>          reverse all output options\n"), out);

Hm?  Shouldn't that be "set reverse video"?
Or maybe "swap foreground and background colors from here"?
It doesn't invert brightness or other attributes.

> +	fputs(_(" --clear         <all|rest>        clear screen and set cursor position\n"), out);

[all|rest]

> +	fputs(_(" --regtabs       <1-160>           set default tab stop position\n"), out);

To be consistent this should be "--regtabs <number>", and then add that
<number> can be 1..160.  But that loses conciseness.

> +	fputs(_(" --blank         <0-60|force|poke> set inactivity interval\n"), out);

--blank  [<number>|force|poke]
and <number> can be 1..60 (minutes)

Benno

-- 
http://www.fastmail.fm - Send your email first class


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 2/4] docs: setterm.1 add missing options to manual page and remove duplicate
  2014-05-24 11:08 ` [PATCH 2/4] docs: setterm.1 add missing options to manual page and remove duplicate Sami Kerola
@ 2014-05-24 12:33   ` Benno Schulenberg
  2014-05-25 10:57     ` Sami Kerola
  0 siblings, 1 reply; 26+ messages in thread
From: Benno Schulenberg @ 2014-05-24 12:33 UTC (permalink / raw)
  To: Sami Kerola; +Cc: Util-Linux


On Sat, May 24, 2014, at 13:08, Sami Kerola wrote:
> +.TP
> +.BR \-\-inversescreen " [" on | off "]"

Previously it had the string "(virtual consoles only)" appended.

> +Invert foreground and background color.

Swap foreground and background colors for the whole screen?

Benno

-- 
http://www.fastmail.fm - Email service worth paying for. Try it for free


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 3/4] docs: setterm.1 add options compatibility note
  2014-05-24 11:08 ` [PATCH 3/4] docs: setterm.1 add options compatibility note Sami Kerola
@ 2014-05-24 12:38   ` Benno Schulenberg
  2014-05-25 10:58     ` Sami Kerola
  0 siblings, 1 reply; 26+ messages in thread
From: Benno Schulenberg @ 2014-05-24 12:38 UTC (permalink / raw)
  To: Sami Kerola; +Cc: Util-Linux


On Sat, May 24, 2014, at 13:08, Sami Kerola wrote:
> +Since version 2.25 the
> +.B setterm
> +has supported long options with two hyphens, for example

s/has supported/has support for/

> +.BR \-\-help ,
> +aside with single hyphen options, for example

s/aside with single hyphen options/
  beside the historical long options with a single hyphen/

> +In scripts it is better to use backward compatibile single hyphen rather

s/use backward /use the backward-/
s/compatibile/compatible/

> +than two hyphens.  Currently there are no plans or good reasons to

s/two hyphens/the double hyphen/

Benno

-- 
http://www.fastmail.fm - A fast, anti-spam email service.


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 4/4] docs: setterm.1 clean up manual page groff style
  2014-05-24 11:08 ` [PATCH 4/4] docs: setterm.1 clean up manual page groff style Sami Kerola
@ 2014-05-24 12:44   ` Benno Schulenberg
  2014-05-25 10:58     ` Sami Kerola
  0 siblings, 1 reply; 26+ messages in thread
From: Benno Schulenberg @ 2014-05-24 12:44 UTC (permalink / raw)
  To: Sami Kerola; +Cc: Util-Linux


On Sat, May 24, 2014, at 13:08, Sami Kerola wrote:
> Underline option arguments, and use bold for options.

Ehm, no, that is not the style.  Italics (underline on a terminal) is
for things that need to be replaced, need to be filled in; bold is for
literal arguments, things that have to be typed as is.

> +.RI ( on
> +or
> +.IR off ),

.RB ( on " or " off )

> +the default is
> +.IR on .

.BR on .

> +.I 8-color

Correct.

> +below is
> +.IR  black ,

.BR black ,

And so on.

Benno

-- 
http://www.fastmail.fm - Or how I learned to stop worrying and
                          love email again


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/4] setterm: add usage() descriptions
  2014-05-24 12:30   ` Benno Schulenberg
@ 2014-05-25 10:57     ` Sami Kerola
  2014-05-25 20:51       ` Benno Schulenberg
  0 siblings, 1 reply; 26+ messages in thread
From: Sami Kerola @ 2014-05-25 10:57 UTC (permalink / raw)
  To: Benno Schulenberg; +Cc: Util-Linux

On 24 May 2014 13:30, Benno Schulenberg <bensberg@justemail.net> wrote:

Hi Benno,

Thank you for all four reviews.

> On Sat, May 24, 2014, at 13:08, Sami Kerola wrote:
>> +     fputs(_(" --inversescreen <on|off>          inverse foreground and background colors\n"), out);
>
> s/inverse/swap/
> s/colors/colors for the whole screen/

The text is updated.

> And all these <on|off> should be [on|off], like in the man page,
> as they are literal arguments and optional.

Ah, I see. It would be really good to get an example of literate
argument to both howtos.

Documentation/howto-man-page.txt
Documentation/howto-usage-function.txt

Maybe something like this

diff --git a/Documentation/howto-man-page.txt b/Documentation/howto-man-page.txt
index 5ca4af0..7ad76a2 100644
--- a/Documentation/howto-man-page.txt
+++ b/Documentation/howto-man-page.txt
@@ -48,6 +48,10 @@ Tell in description option
 .I argument
 is required.
 .TP
+\fB\-l\fR, \fB\-\-literal\fR \fIword\fR
+Tell in description option argument is required and that it can be only
+.BR word .
+.TP
 \fB\-V\fR, \fB\-\-version\fR
 Display version information and exit.
 .TP
diff --git a/Documentation/howto-usage-function.txt
b/Documentation/howto-usage-function.txt
index dd1f4ed..c37ea0f 100644
--- a/Documentation/howto-usage-function.txt
+++ b/Documentation/howto-usage-function.txt
@@ -47,6 +47,7 @@ Options:
  -n, --no-argument       option does not use argument
  -o, --optional[=<arg>]  option argument is optional
  -r, --required <arg>    option requires an argument
+ -L, --literal [arg|foo] required argument is one of the literal strings
  -z                      no long option
      --xyzzy             a long option only
  -e, --extremely-long-long-option

>> +     fputs(_(" --foreground    <default|color>   set foreground color\n"), out);
>
> default|<color>

Colors are literal strings so [color], and that can be short cut to
[default|color] where color possibilities are explained in later line.

>> +     fputs(_(" --reverse       <on|off>          reverse all output options\n"), out);
>
> Hm?  Shouldn't that be "set reverse video"?
> Or maybe "swap foreground and background colors from here"?
> It doesn't invert brightness or other attributes.
>
>> +     fputs(_(" --clear         <all|rest>        clear screen and set cursor position\n"), out);
>
> [all|rest]
>
>> +     fputs(_(" --regtabs       <1-160>           set default tab stop position\n"), out);
>
> To be consistent this should be "--regtabs <number>", and then add that
> <number> can be 1..160.  But that loses conciseness.

Options --tab argument <number> defines length of a specific tab,
while the --regtabs is a range. In former the number is value, and in
later more like literal string, constant, or a definition.

>> +     fputs(_(" --blank         <0-60|force|poke> set inactivity interval\n"), out);
>
> --blank  [<number>|force|poke]
> and <number> can be 1..60 (minutes)

Same here. This dualistic 'number as value' and 'number as definition'
may need an example to howtos files. IMHO the long description in
which range is '<number>' and later text tells '<number> has range 1
to 60' is too verbose, good usage() is brief, man page as verbose as
needed.

New version:
https://github.com/kerolasa/lelux-utiliteetit/commit/2354f1f8085b93c50505fe4fb09b1792153d75f1

-- 
Sami Kerola
http://www.iki.fi/kerolasa/

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH 2/4] docs: setterm.1 add missing options to manual page and remove duplicate
  2014-05-24 12:33   ` Benno Schulenberg
@ 2014-05-25 10:57     ` Sami Kerola
  0 siblings, 0 replies; 26+ messages in thread
From: Sami Kerola @ 2014-05-25 10:57 UTC (permalink / raw)
  To: Benno Schulenberg; +Cc: Util-Linux

On 24 May 2014 13:33, Benno Schulenberg <bensberg@justemail.net> wrote:
> On Sat, May 24, 2014, at 13:08, Sami Kerola wrote:
>> +.TP
>> +.BR \-\-inversescreen " [" on | off "]"
>
> Previously it had the string "(virtual consoles only)" appended.

Commit 78dd23c changed that. Point taken, I should double check the
"(virtual consoles only)" in manual page being aligned with the code.

>> +Invert foreground and background color.
>
> Swap foreground and background colors for the whole screen?

That is better.

New version:
https://github.com/kerolasa/lelux-utiliteetit/commit/b660237b7bd2e72e0a6d9c765b286ac6a6a405e2

-- 
Sami Kerola
http://www.iki.fi/kerolasa/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 3/4] docs: setterm.1 add options compatibility note
  2014-05-24 12:38   ` Benno Schulenberg
@ 2014-05-25 10:58     ` Sami Kerola
  0 siblings, 0 replies; 26+ messages in thread
From: Sami Kerola @ 2014-05-25 10:58 UTC (permalink / raw)
  To: Benno Schulenberg; +Cc: Util-Linux

On 24 May 2014 13:38, Benno Schulenberg <bensberg@justemail.net> wrote:
> On Sat, May 24, 2014, at 13:08, Sami Kerola wrote:
>> +Since version 2.25 the
>> +.B setterm
>> +has supported long options with two hyphens, for example
>
> s/has supported/has support for/
>
>> +.BR \-\-help ,
>> +aside with single hyphen options, for example
>
> s/aside with single hyphen options/
>   beside the historical long options with a single hyphen/
>
>> +In scripts it is better to use backward compatibile single hyphen rather
>
> s/use backward /use the backward-/
> s/compatibile/compatible/
>
>> +than two hyphens.  Currently there are no plans or good reasons to
>
> s/two hyphens/the double hyphen/

Thank you again.

New version:
https://github.com/kerolasa/lelux-utiliteetit/commit/94740821907e95f65584762bd362d8b1946e1eb8

-- 
Sami Kerola
http://www.iki.fi/kerolasa/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 4/4] docs: setterm.1 clean up manual page groff style
  2014-05-24 12:44   ` Benno Schulenberg
@ 2014-05-25 10:58     ` Sami Kerola
  2014-05-25 21:10       ` Benno Schulenberg
  0 siblings, 1 reply; 26+ messages in thread
From: Sami Kerola @ 2014-05-25 10:58 UTC (permalink / raw)
  To: Benno Schulenberg; +Cc: Util-Linux

On 24 May 2014 13:44, Benno Schulenberg <bensberg@justemail.net> wrote:
> On Sat, May 24, 2014, at 13:08, Sami Kerola wrote:
>> Underline option arguments, and use bold for options.
>
> Ehm, no, that is not the style.  Italics (underline on a terminal) is
> for things that need to be replaced, need to be filled in; bold is for
> literal arguments, things that have to be typed as is.

That convention should be documented. Meanwhile I hope the following
is a bit closer how the manual should be.

New version:
https://github.com/kerolasa/lelux-utiliteetit/commit/bbc05cc2e30a6d6a3adcc7207d5549b782f03574

-- 
Sami Kerola
http://www.iki.fi/kerolasa/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/4] setterm: add usage() descriptions
  2014-05-25 10:57     ` Sami Kerola
@ 2014-05-25 20:51       ` Benno Schulenberg
  0 siblings, 0 replies; 26+ messages in thread
From: Benno Schulenberg @ 2014-05-25 20:51 UTC (permalink / raw)
  To: kerolasa; +Cc: Util-Linux


On Sun, May 25, 2014, at 12:57, Sami Kerola wrote:
> Ah, I see. It would be really good to get an example of literate
> argument to both howtos.
> 
> Documentation/howto-man-page.txt
> Documentation/howto-usage-function.txt
> 
> Maybe something like this
> 
> diff --git a/Documentation/howto-man-page.txt b/Documentation/howto-man-page.txt
> [...]
>  .TP
> +\fB\-l\fR, \fB\-\-literal\fR \fIword\fR
> +Tell in description option argument is required and that it can be only
> +.BR word .

Well, yes, but it should be \fBword\fR. -- bold.

> + -L, --literal [arg|foo] required argument is one of the literal strings

Yes, but better not use the word "arg" because it sounds too much
like it has to be replaced with something.  Better: "--literal [foo|baz]".

> >> +     fputs(_(" --foreground    <default|color>   set foreground color\n"), out);
> >
> > default|<color>
> 
> Colors are literal strings so [color], and that can be short cut to
> [default|color] where color possibilities are explained in later line.

...  No!  Yes, colors are literal strings, but not the word color itself,
that's why it's written as <color>.  ...  Okay, let's say this differently:
--foreground is an option, it can take nine or ten different arguments.
One of the possible arguments is the literal word "default", and all
the other ones are names for colors, but not the word "color" itself,
of course -- so it is written as "default|<color>".  And the argument
of --foreground is not optional, so no square brackets.


> >> +     fputs(_(" --regtabs       <1-160>           set default tab stop position\n"), out);
> >
> > To be consistent this should be "--regtabs <number>", and then add that
> > <number> can be 1..160.  But that loses conciseness.
> 
> Options --tab argument <number> defines length of a specific tab,
> while the --regtabs is a range. In former the number is value, and in
> later more like literal string, constant, or a definition.

??  ...  I think you have the two mixed up.  The option --tabs takes a sequence
of numbers as arguments, so it should be "<number>..." (it probably should be
an ascending sequence, but the man page doesn't say).  The option --regtabs
takes a single number as argument, so "<number>" -- 'regtabs' seems to be
short for "regular tabs" or "tabs at a regular interval", and the number gives
the size of the interval.  All these numbers are constant values.

> >> +     fputs(_(" --blank         <0-60|force|poke> set inactivity interval\n"), out);
> >
> > --blank  [<number>|force|poke]
> > and <number> can be 1..60 (minutes)
> 
> Same here. This dualistic 'number as value' and 'number as definition'

I don't understand what you mean with this dualistic nature.

> may need an example to howtos files. IMHO the long description in
> which range is '<number>' and later text tells '<number> has range 1
> to 60' is too verbose, good usage() is brief, man page as verbose as
> needed.

Yes, I agree that using <number> and then explaining what <number> can be
is somewhat verbose, so it is okay to use "--blank  [0-60|force|poke]",
like the man page does.

Benno

-- 
http://www.fastmail.fm - Send your email first class


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 4/4] docs: setterm.1 clean up manual page groff style
  2014-05-25 10:58     ` Sami Kerola
@ 2014-05-25 21:10       ` Benno Schulenberg
  2014-05-26  8:42         ` Sami Kerola
  0 siblings, 1 reply; 26+ messages in thread
From: Benno Schulenberg @ 2014-05-25 21:10 UTC (permalink / raw)
  To: kerolasa; +Cc: Util-Linux


On Sun, May 25, 2014, at 12:58, Sami Kerola wrote:
> That convention should be documented. Meanwhile I hope the following
> is a bit closer how the manual should be.
> 
> New version:
> https://github.com/kerolasa/lelux-utiliteetit/commit/bbc05cc2e30a6d6a3adcc7207d5549b782f03574

> -.B force
> +.I force

This and poke are literal arguments and should stay bold.

> -.B \-\-default
> +\fB\-\-default\fP

Why do you make this kind of changes?  The first is perfectly fine
and more readable.

I am not going to make any more detailed comments, it's much
easier to later simply provide a patch.

Benno

-- 
http://www.fastmail.fm - Choose from over 50 domains or use your own


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 4/4] docs: setterm.1 clean up manual page groff style
  2014-05-25 21:10       ` Benno Schulenberg
@ 2014-05-26  8:42         ` Sami Kerola
  2014-05-26 10:11           ` Karel Zak
  0 siblings, 1 reply; 26+ messages in thread
From: Sami Kerola @ 2014-05-26  8:42 UTC (permalink / raw)
  To: Benno Schulenberg; +Cc: Util-Linux

On 25 May 2014 22:10, Benno Schulenberg <bensberg@justemail.net> wrote:
> On Sun, May 25, 2014, at 12:58, Sami Kerola wrote:
>> That convention should be documented. Meanwhile I hope the following
>> is a bit closer how the manual should be.
>>
>> New version:
>> https://github.com/kerolasa/lelux-utiliteetit/commit/bbc05cc2e30a6d6a3adcc7207d5549b782f03574
>
>> -.B force
>> +.I force
>
> This and poke are literal arguments and should stay bold.

Thank you, I missed them.

https://github.com/kerolasa/lelux-utiliteetit/commit/bbc05cc2e30a6d6a3adcc7207d5549b782f03574

>> -.B \-\-default
>> +\fB\-\-default\fP
>
> Why do you make this kind of changes?  The first is perfectly fine
> and more readable.

I find it more readable when options after .TP are always using
\fB...\fR, what is the only way to make optional option with arguments
and other complex cases to work. Making the simple cases look a like
the other cases feels correct to me.

> I am not going to make any more detailed comments, it's much
> easier to later simply provide a patch.

Would you mind writing the howto update in same go?

-- 
Sami Kerola
http://www.iki.fi/kerolasa/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 4/4] docs: setterm.1 clean up manual page groff style
  2014-05-26  8:42         ` Sami Kerola
@ 2014-05-26 10:11           ` Karel Zak
  2014-05-26 15:46             ` Sami Kerola
  0 siblings, 1 reply; 26+ messages in thread
From: Karel Zak @ 2014-05-26 10:11 UTC (permalink / raw)
  To: kerolasa; +Cc: Benno Schulenberg, Util-Linux

On Mon, May 26, 2014 at 09:42:05AM +0100, Sami Kerola wrote:
> On 25 May 2014 22:10, Benno Schulenberg <bensberg@justemail.net> wrote:
> > On Sun, May 25, 2014, at 12:58, Sami Kerola wrote:
> >> That convention should be documented. Meanwhile I hope the following
> >> is a bit closer how the manual should be.
> >>
> >> New version:
> >> https://github.com/kerolasa/lelux-utiliteetit/commit/bbc05cc2e30a6d6a3adcc7207d5549b782f03574
> >
> >> -.B force
> >> +.I force
> >
> > This and poke are literal arguments and should stay bold.
> 
> Thank you, I missed them.
> 
> https://github.com/kerolasa/lelux-utiliteetit/commit/bbc05cc2e30a6d6a3adcc7207d5549b782f03574

 BTW, it would be really nice to have per feature/issue branches
 rather than only branch 2014wk20 with setterm, uuidd and rename
 changes :-)

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 4/4] docs: setterm.1 clean up manual page groff style
  2014-05-26 10:11           ` Karel Zak
@ 2014-05-26 15:46             ` Sami Kerola
  2014-05-27 14:46               ` Karel Zak
  0 siblings, 1 reply; 26+ messages in thread
From: Sami Kerola @ 2014-05-26 15:46 UTC (permalink / raw)
  To: Karel Zak; +Cc: Benno Schulenberg, Util-Linux

On 26 May 2014 11:11, Karel Zak <kzak@redhat.com> wrote:
>  BTW, it would be really nice to have per feature/issue branches
>  rather than only branch 2014wk20 with setterm, uuidd and rename
>  changes :-)

Hi Karel,

Here you are. The changes are the same, with one exception; uuidd
--timeout vs --socket-activation exclusion is gone.

git://github.com/kerolasa/lelux-utiliteetit.git uuid
git://github.com/kerolasa/lelux-utiliteetit.git rename
git://github.com/kerolasa/lelux-utiliteetit.git setterm

-- 
Sami Kerola
http://www.iki.fi/kerolasa/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 4/4] docs: setterm.1 clean up manual page groff style
  2014-05-26 15:46             ` Sami Kerola
@ 2014-05-27 14:46               ` Karel Zak
  2014-05-29  9:48                 ` Sami Kerola
  0 siblings, 1 reply; 26+ messages in thread
From: Karel Zak @ 2014-05-27 14:46 UTC (permalink / raw)
  To: kerolasa; +Cc: Benno Schulenberg, Util-Linux

On Mon, May 26, 2014 at 04:46:12PM +0100, Sami Kerola wrote:
> git://github.com/kerolasa/lelux-utiliteetit.git uuid

 merged

> git://github.com/kerolasa/lelux-utiliteetit.git rename

 Not merged, it seems that the tests still uses the current directory
 rather than $TS_OUTDIR, right?

> git://github.com/kerolasa/lelux-utiliteetit.git setterm

 merged

 Thanks!

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 4/4] docs: setterm.1 clean up manual page groff style
  2014-05-27 14:46               ` Karel Zak
@ 2014-05-29  9:48                 ` Sami Kerola
  2014-05-29 10:23                   ` Ruediger Meier
  0 siblings, 1 reply; 26+ messages in thread
From: Sami Kerola @ 2014-05-29  9:48 UTC (permalink / raw)
  To: Karel Zak; +Cc: Benno Schulenberg, Util-Linux

On 27 May 2014 15:46, Karel Zak <kzak@redhat.com> wrote:
> On Mon, May 26, 2014 at 04:46:12PM +0100, Sami Kerola wrote:
>> git://github.com/kerolasa/lelux-utiliteetit.git rename
>
>  Not merged, it seems that the tests still uses the current directory
>  rather than $TS_OUTDIR, right?

Oh, that's a beginner mistake. Fix is available in same git remote
location. All I did was a cd before file operations in each script,
something like this:

+++ b/tests/ts/rename/basic
@@ -22,6 +22,7 @@ TS_DESC="basic check"
 ts_init "$*"

 ts_check_test_command "$TS_CMD_RENAME"
+cd $TS_OUTDIR

-- 
Sami Kerola
http://www.iki.fi/kerolasa/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 4/4] docs: setterm.1 clean up manual page groff style
  2014-05-29  9:48                 ` Sami Kerola
@ 2014-05-29 10:23                   ` Ruediger Meier
  2014-05-30  7:44                     ` Sami Kerola
  0 siblings, 1 reply; 26+ messages in thread
From: Ruediger Meier @ 2014-05-29 10:23 UTC (permalink / raw)
  To: kerolasa; +Cc: Karel Zak, Benno Schulenberg, Util-Linux

On Thursday 29 May 2014, Sami Kerola wrote:
> On 27 May 2014 15:46, Karel Zak <kzak@redhat.com> wrote:
> > On Mon, May 26, 2014 at 04:46:12PM +0100, Sami Kerola wrote:
> >> git://github.com/kerolasa/lelux-utiliteetit.git rename
> >
> >  Not merged, it seems that the tests still uses the current directory
> >  rather than $TS_OUTDIR, right?
> 
> Oh, that's a beginner mistake. Fix is available in same git remote
> location. All I did was a cd before file operations in each script,
> something like this:
> 
> +++ b/tests/ts/rename/basic
> @@ -22,6 +22,7 @@ TS_DESC="basic check"
>  ts_init "$*"
> 
>  ts_check_test_command "$TS_CMD_RENAME"
> +cd $TS_OUTDIR
> 

I know we are doing similar already in other tests too. IMO cd in scripts can be very dangerous, specially if there is no error handling.

For example if ts_init is broken (while you are working on it) and TS_OUTDIR would be unset then "cd $TS_OUTDIR" would jump into your $HOME ... which could be really bad.

At least I would quote it
  cd "$TS_OUTDIR"
or even better
  cd "$TS_OUTDIR" || exit 1

cu,
Rudi

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 4/4] docs: setterm.1 clean up manual page groff style
  2014-05-29 10:23                   ` Ruediger Meier
@ 2014-05-30  7:44                     ` Sami Kerola
  2014-06-01 22:35                       ` Ruediger Meier
  0 siblings, 1 reply; 26+ messages in thread
From: Sami Kerola @ 2014-05-30  7:44 UTC (permalink / raw)
  To: Ruediger Meier; +Cc: Karel Zak, Benno Schulenberg, Util-Linux

On 29 May 2014 11:23, Ruediger Meier <sweet_f_a@gmx.de> wrote:
> On Thursday 29 May 2014, Sami Kerola wrote:
>> On 27 May 2014 15:46, Karel Zak <kzak@redhat.com> wrote:
>> > On Mon, May 26, 2014 at 04:46:12PM +0100, Sami Kerola wrote:
>> >> git://github.com/kerolasa/lelux-utiliteetit.git rename
>> >
>> >  Not merged, it seems that the tests still uses the current directory
>> >  rather than $TS_OUTDIR, right?
>>
>> Oh, that's a beginner mistake. Fix is available in same git remote
>> location. All I did was a cd before file operations in each script,
>> something like this:
>>
>> +++ b/tests/ts/rename/basic
>> @@ -22,6 +22,7 @@ TS_DESC="basic check"
>>  ts_init "$*"
>>
>>  ts_check_test_command "$TS_CMD_RENAME"
>> +cd $TS_OUTDIR
>
> I know we are doing similar already in other tests too. IMO cd in scripts can be very dangerous, specially if there is no error handling.
>
> For example if ts_init is broken (while you are working on it) and TS_OUTDIR would be unset then "cd $TS_OUTDIR" would jump into your $HOME ... which could be really bad.
>
> At least I would quote it
>   cd "$TS_OUTDIR"
> or even better
>   cd "$TS_OUTDIR" || exit 1

Hi Rudi,

Good point. I changed my git to have the better change dir you proposed.

What would you think adding exit on error[1], disallow referrals to
unset variables[2], and make any errors in pipe chains to cause exit
on error to blow up[3], as default in ts_init()? I use in my own
scripts these as default settings, and when I refactor scripts I tend
to add these to make them more robust. Down side is that these
settings often cause quite a bit changes, which would mean the change
should not be considered before the release v2.25 is out.

[1] set -e && trap 'ts_failed "exit on error"' ERR
[2] set -u
[3] set -o pipefail

-- 
Sami Kerola
http://www.iki.fi/kerolasa/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 4/4] docs: setterm.1 clean up manual page groff style
  2014-05-30  7:44                     ` Sami Kerola
@ 2014-06-01 22:35                       ` Ruediger Meier
  2014-06-02 16:42                         ` Sami Kerola
  0 siblings, 1 reply; 26+ messages in thread
From: Ruediger Meier @ 2014-06-01 22:35 UTC (permalink / raw)
  To: kerolasa; +Cc: Karel Zak, Benno Schulenberg, Util-Linux

On Friday 30 May 2014, Sami Kerola wrote:
> On 29 May 2014 11:23, Ruediger Meier <sweet_f_a@gmx.de> wrote:
> > On Thursday 29 May 2014, Sami Kerola wrote:
> >> On 27 May 2014 15:46, Karel Zak <kzak@redhat.com> wrote:
> >> > On Mon, May 26, 2014 at 04:46:12PM +0100, Sami Kerola wrote:
> >> >> git://github.com/kerolasa/lelux-utiliteetit.git rename
> >> >
> >> >  Not merged, it seems that the tests still uses the current
> >> > directory rather than $TS_OUTDIR, right?
> >>
> >> Oh, that's a beginner mistake. Fix is available in same git remote
> >> location. All I did was a cd before file operations in each
> >> script, something like this:
> >>
> >> +++ b/tests/ts/rename/basic
> >> @@ -22,6 +22,7 @@ TS_DESC="basic check"
> >>  ts_init "$*"
> >>
> >>  ts_check_test_command "$TS_CMD_RENAME"
> >> +cd $TS_OUTDIR
> >
> > I know we are doing similar already in other tests too. IMO cd in
> > scripts can be very dangerous, specially if there is no error
> > handling.
> >
> > For example if ts_init is broken (while you are working on it) and
> > TS_OUTDIR would be unset then "cd $TS_OUTDIR" would jump into your
> > $HOME ... which could be really bad.
> >
> > At least I would quote it
> >   cd "$TS_OUTDIR"
> > or even better
> >   cd "$TS_OUTDIR" || exit 1
>
> Hi Rudi,
>
> Good point. I changed my git to have the better change dir you
> proposed.

BTW I just noticed that bash's
$ cd ''
does NOT return error. But
$ /usr/bin/cd ''
does like it should IMO.

> What would you think adding exit on error[1], disallow referrals to
> unset variables[2], and make any errors in pipe chains to cause exit
> on error to blow up[3], as default in ts_init()? I use in my own
> scripts these as default settings, and when I refactor scripts I tend
> to add these to make them more robust. Down side is that these
> settings often cause quite a bit changes, which would mean the change
> should not be considered before the release v2.25 is out.

I'am not fully convinced about this. It would require much review and 
code change of all tests and functions.

> [1] set -e && trap 'ts_failed "exit on error"' ERR
> [2] set -u
> [3] set -o pipefail

IMO "pipefail" and "-e" are very debatable. Sometimes I like pipefail 
but mostly not. Look for example something like this "do something with 
some files if we found one":
$ ls | grep "a-file-which-exists-sometimes" | xargs -r do_something

pipefail would mess up do_something's return value. And "-e" would even 
abort the script.

$ file_list=$(ls | grep "a-file-which-exists-sometimes")
would also fail with "-e". 

I'm even a bit unhappy that currently some tests have already "set -o 
pipefail". It may break certain functions sourced from 
tests/functions.sh. It's very hard to write global shell functions 
which would survive any shopt combination.

cu,
Rudi

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 4/4] docs: setterm.1 clean up manual page groff style
  2014-06-01 22:35                       ` Ruediger Meier
@ 2014-06-02 16:42                         ` Sami Kerola
  2014-06-02 21:23                           ` Bernhard Voelker
  0 siblings, 1 reply; 26+ messages in thread
From: Sami Kerola @ 2014-06-02 16:42 UTC (permalink / raw)
  To: Ruediger Meier; +Cc: Karel Zak, Benno Schulenberg, Util-Linux

On 1 June 2014 23:35, Ruediger Meier <sweet_f_a@gmx.de> wrote:
>> > At least I would quote it
>> >   cd "$TS_OUTDIR"
>> > or even better
>> >   cd "$TS_OUTDIR" || exit 1
>>
>> Hi Rudi,
>>
>> Good point. I changed my git to have the better change dir you
>> proposed.
>
> BTW I just noticed that bash's
> $ cd ''
> does NOT return error. But
> $ /usr/bin/cd ''
> does like it should IMO.

Karel,

Please drop the rename changes for now. They do not seem to be ready
before v2.25. Lets see afterwards what could or should be done to
rename, and others tests that change direcrory.

-- 
Sami Kerola
http://www.iki.fi/kerolasa/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 4/4] docs: setterm.1 clean up manual page groff style
  2014-06-02 16:42                         ` Sami Kerola
@ 2014-06-02 21:23                           ` Bernhard Voelker
  2014-06-02 21:35                             ` Ruediger Meier
  0 siblings, 1 reply; 26+ messages in thread
From: Bernhard Voelker @ 2014-06-02 21:23 UTC (permalink / raw)
  To: Ruediger Meier; +Cc: kerolasa, Karel Zak, Benno Schulenberg, Util-Linux

> On 1 June 2014 23:35, Ruediger Meier <sweet_f_a@gmx.de> wrote:
> BTW I just noticed that bash's
> $ cd ''
> does NOT return error. But
> $ /usr/bin/cd ''
> does like it should IMO.

What is /usr/bin/cd? As this would do the chdir() in
a very-short-living sub-process, I'd consider this a
useless program (apart from checking whether chdir()ing
into the given directory would succeed).

Have a nice day,
Berny

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 4/4] docs: setterm.1 clean up manual page groff style
  2014-06-02 21:23                           ` Bernhard Voelker
@ 2014-06-02 21:35                             ` Ruediger Meier
  0 siblings, 0 replies; 26+ messages in thread
From: Ruediger Meier @ 2014-06-02 21:35 UTC (permalink / raw)
  To: Bernhard Voelker; +Cc: kerolasa, Karel Zak, Benno Schulenberg, Util-Linux

On Monday 02 June 2014, Bernhard Voelker wrote:
> > On 1 June 2014 23:35, Ruediger Meier <sweet_f_a@gmx.de> wrote:
> > BTW I just noticed that bash's
> > $ cd ''
> > does NOT return error. But
> > $ /usr/bin/cd ''
> > does like it should IMO.
>
> What is /usr/bin/cd? As this would do the chdir() in
> a very-short-living sub-process, I'd consider this a
> useless program (apart from checking whether chdir()ing
> into the given directory would succeed).
>
> Have a nice day,
> Berny
> --
> To unsubscribe from this list: send the line "unsubscribe util-linux"
> in the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Ooops :) Of course it does not exist. But the error
looks (almost) plausible, lol

$ /usr/bin/cd ""
sh: /usr/bin/cd: No such file or directory

cu,
Rudi

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2014-06-02 21:35 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-24 11:08 [PATCH 0/4] setterm: documentation updates Sami Kerola
2014-05-24 11:08 ` [PATCH 1/4] setterm: add usage() descriptions Sami Kerola
2014-05-24 12:30   ` Benno Schulenberg
2014-05-25 10:57     ` Sami Kerola
2014-05-25 20:51       ` Benno Schulenberg
2014-05-24 11:08 ` [PATCH 2/4] docs: setterm.1 add missing options to manual page and remove duplicate Sami Kerola
2014-05-24 12:33   ` Benno Schulenberg
2014-05-25 10:57     ` Sami Kerola
2014-05-24 11:08 ` [PATCH 3/4] docs: setterm.1 add options compatibility note Sami Kerola
2014-05-24 12:38   ` Benno Schulenberg
2014-05-25 10:58     ` Sami Kerola
2014-05-24 11:08 ` [PATCH 4/4] docs: setterm.1 clean up manual page groff style Sami Kerola
2014-05-24 12:44   ` Benno Schulenberg
2014-05-25 10:58     ` Sami Kerola
2014-05-25 21:10       ` Benno Schulenberg
2014-05-26  8:42         ` Sami Kerola
2014-05-26 10:11           ` Karel Zak
2014-05-26 15:46             ` Sami Kerola
2014-05-27 14:46               ` Karel Zak
2014-05-29  9:48                 ` Sami Kerola
2014-05-29 10:23                   ` Ruediger Meier
2014-05-30  7:44                     ` Sami Kerola
2014-06-01 22:35                       ` Ruediger Meier
2014-06-02 16:42                         ` Sami Kerola
2014-06-02 21:23                           ` Bernhard Voelker
2014-06-02 21:35                             ` Ruediger Meier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.