coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: begin updating for new quoting style


From: Jim Meyering
Subject: Re: begin updating for new quoting style
Date: Sat, 07 Jan 2012 17:20:29 +0100

Jim Meyering wrote:
> Now that gnulib's quote/quotearg use 'quotes', not `quotes'
> begin the process of updating coreutils and its tests
> to match that new behavior.
>
> Blindly updating to latest from gnulib would have induced 87 test failures.
>
...
>>From 2e870665301417ce36e9fc00621dfa2e7827d474 Mon Sep 17 00:00:00 2001
> From: Jim Meyering <address@hidden>
> Date: Sat, 7 Jan 2012 17:10:50 +0100
> Subject: [PATCH 3/3] maint: update quoting of "Try `prog --help'" to "Try
>  'prog --help'"
>
> Automatically adjust both the source (now in only one place)
> and all tests that expect the resulting output via this:
>
> git grep -l 'Try.*--help' src/system.h tests \
>   | xargs perl -pi -e 's/Try \\?`(\S+ --help)/'\''$1/'

That removed the "Try ".
This does it properly:

>From 8ac05f82a263364310dc9d8bfd734c478c03fbdd Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sat, 7 Jan 2012 17:18:14 +0100
Subject: [PATCH] maint: update quoting of "Try `prog --help'" to "Try 'prog
 --help'"

Automatically adjust both the source (now in only one place)
and all tests that expect the resulting output via this:

git grep -l 'Try.*--help' src/system.h tests \
  | xargs perl -pi -e 's/Try \\?`(\S+ --help)/Try '\''$1/'
---
 src/system.h                |    2 +-
 tests/du/files0-from        |    2 +-
 tests/ls/time-style-diag    |    2 +-
 tests/misc/basename         |    4 ++--
 tests/misc/comm             |    6 +++---
 tests/misc/cut              |    2 +-
 tests/misc/dirname          |    4 ++--
 tests/misc/expr             |    2 +-
 tests/misc/factor           |    2 +-
 tests/misc/fmt              |    2 +-
 tests/misc/invalid-opt      |    2 +-
 tests/misc/mktemp           |    4 ++--
 tests/misc/printf-cov       |    2 +-
 tests/misc/seq              |    2 +-
 tests/misc/sort-files0-from |    2 +-
 tests/misc/tsort            |    2 +-
 tests/misc/uniq             |    2 +-
 tests/misc/wc-files0-from   |    2 +-
 tests/mv/diag               |    4 ++--
 19 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/src/system.h b/src/system.h
index ff88cb4..9948aed 100644
--- a/src/system.h
+++ b/src/system.h
@@ -559,7 +559,7 @@ emit_ancillary_info (void)
 static inline void
 emit_try_help (void)
 {
-  fprintf (stderr, _("Try `%s --help' for more information.\n"), program_name);
+  fprintf (stderr, _("Try '%s --help' for more information.\n"), program_name);
 }

 #include "inttostr.h"
diff --git a/tests/du/files0-from b/tests/du/files0-from
index d617540..fb25c3f 100755
--- a/tests/du/files0-from
+++ b/tests/du/files0-from
@@ -32,7 +32,7 @@ my @Tests =
    ['f-extra-arg', '--files0-from=- no-such', {IN=>"a"}, {EXIT=>1},
     {ERR => "$prog: extra operand `no-such'\n"
         . "file operands cannot be combined with --files0-from\n"
-        . "Try `$prog --help' for more information.\n"}
+        . "Try '$prog --help' for more information.\n"}
     ],

    # missing input file
diff --git a/tests/ls/time-style-diag b/tests/ls/time-style-diag
index 00a0c20..ba8c1c8 100755
--- a/tests/ls/time-style-diag
+++ b/tests/ls/time-style-diag
@@ -30,7 +30,7 @@ Valid arguments are:
   - [posix-]iso
   - [posix-]locale
   - +FORMAT (e.g., +%H:%M) for a `date'-style format
-Try `ls --help' for more information.
+Try 'ls --help' for more information.
 EOF

 compare exp err || fail=1
diff --git a/tests/misc/basename b/tests/misc/basename
index 9006e60..6bd5e40 100755
--- a/tests/misc/basename
+++ b/tests/misc/basename
@@ -33,9 +33,9 @@ my $prog = 'basename';
 my @Tests =
     (
      ['fail-1', {ERR => "$prog: missing operand\n"
-       . "Try `$prog --help' for more information.\n"}, {EXIT => '1'}],
+       . "Try '$prog --help' for more information.\n"}, {EXIT => '1'}],
      ['fail-2', qw(a b c), {ERR => "$prog: extra operand `c'\n"
-       . "Try `$prog --help' for more information.\n"}, {EXIT => '1'}],
+       . "Try '$prog --help' for more information.\n"}, {EXIT => '1'}],

      ['a', qw(d/f),        {OUT => 'f'}],
      ['b', qw(/d/f),       {OUT => 'f'}],
diff --git a/tests/misc/comm b/tests/misc/comm
index ed56740..c727f80 100755
--- a/tests/misc/comm
+++ b/tests/misc/comm
@@ -58,17 +58,17 @@ my @Tests =
    # invalid missing command line argument (1)
    ['missing-arg1', $inputs[0], {EXIT=>1},
     {ERR => "$prog: missing operand after `a'\n"
-        . "Try `$prog --help' for more information.\n"}],
+        . "Try '$prog --help' for more information.\n"}],

    # invalid missing command line argument (both)
    ['missing-arg2', {EXIT=>1},
     {ERR => "$prog: missing operand\n"
-        . "Try `$prog --help' for more information.\n"}],
+        . "Try '$prog --help' for more information.\n"}],

    # invalid extra command line argument
    ['extra-arg', @inputs, 'no-such', {EXIT=>1},
     {ERR => "$prog: extra operand `no-such'\n"
-        . "Try `$prog --help' for more information.\n"}],
+        . "Try '$prog --help' for more information.\n"}],

    # out-of-order input
    ['ooo', {IN=>{a=>"1\n3"}}, {IN=>{b=>"3\n2"}}, {EXIT=>1},
diff --git a/tests/misc/cut b/tests/misc/cut
index 0114d65..8c3676e 100755
--- a/tests/misc/cut
+++ b/tests/misc/cut
@@ -28,7 +28,7 @@ my $mb_locale = $ENV{LOCALE_FR_UTF8};
   and $mb_locale = 'C';

 my $prog = 'cut';
-my $try = "Try \`$prog --help' for more information.\n";
+my $try = "Try '$prog --help' for more information.\n";
 my $from_1 = "$prog: fields and positions are numbered from 1\n$try";
 my $inval = "$prog: invalid byte or field list\n$try";
 my $no_endpoint = "$prog: invalid range with no endpoint: -\n$try";
diff --git a/tests/misc/dirname b/tests/misc/dirname
index 2e6c8cc..5934b25 100755
--- a/tests/misc/dirname
+++ b/tests/misc/dirname
@@ -34,9 +34,9 @@ my $prog = 'dirname';
 my @Tests =
     (
      ['fail-1', {ERR => "$prog: missing operand\n"
-       . "Try `$prog --help' for more information.\n"}, {EXIT => '1'}],
+       . "Try '$prog --help' for more information.\n"}, {EXIT => '1'}],
      ['fail-2', qw(a b), {ERR => "$prog: extra operand `b'\n"
-       . "Try `$prog --help' for more information.\n"}, {EXIT => '1'}],
+       . "Try '$prog --help' for more information.\n"}, {EXIT => '1'}],

      ['a', qw(d/f),        {OUT => 'd'}],
      ['b', qw(/d/f),       {OUT => '/d'}],
diff --git a/tests/misc/expr b/tests/misc/expr
index 9cc1f9d..be757e2 100755
--- a/tests/misc/expr
+++ b/tests/misc/expr
@@ -159,7 +159,7 @@ my @Tests =
      ['fail-b', '9 9', {ERR => "$prog: syntax error\n"},
       {EXIT => 2}],
      ['fail-c', {ERR => "$prog: missing operand\n"
-                 . "Try `$prog --help' for more information.\n"},
+                 . "Try '$prog --help' for more information.\n"},
       {EXIT => 2}],

      ['bignum-add', "$big + 1", {OUT => $big_p1}],
diff --git a/tests/misc/factor b/tests/misc/factor
index 6c11c70..71f850a 100755
--- a/tests/misc/factor
+++ b/tests/misc/factor
@@ -59,7 +59,7 @@ my @Tests =
      ['z', '-1',
       {ERR_SUBST => q!s/'1'/1/!}, # map newer glibc diagnostic to expected.
       {ERR => "$prog: invalid option -- 1\n"
-       . "Try `$prog --help' for more information.\n"},
+       . "Try '$prog --help' for more information.\n"},
       {EXIT => 1}],
      ['cont', 'a 4',
       {OUT => "4: 2 2\n"},
diff --git a/tests/misc/fmt b/tests/misc/fmt
index 29858fe..ef10e82 100755
--- a/tests/misc/fmt
+++ b/tests/misc/fmt
@@ -37,7 +37,7 @@ my @Tests =
      ['obs-1', '-c -72',
       {ERR => "fmt: invalid option -- 7; -WIDTH is recognized only when it"
        . " is the first\noption; use -w N instead\n"
-       . "Try `fmt --help' for more information.\n" }, {EXIT => 1}],
+       . "Try 'fmt --help' for more information.\n" }, {EXIT => 1}],

      # With --prefix=P, do not remove leading space on lines without the 
prefix.
      ['pfx-1', qw (-p '>'),
diff --git a/tests/misc/invalid-opt b/tests/misc/invalid-opt
index 68e61df..8eae3c2 100755
--- a/tests/misc/invalid-opt
+++ b/tests/misc/invalid-opt
@@ -65,7 +65,7 @@ foreach my $prog (@built_programs)
     $prog eq '['
       and next;

-    my $try = "Try \`$prog --help' for more information.\n";
+    my $try = "Try '$prog --help' for more information.\n";
     my $x = $exit_status{$prog};
     defined $x
       or $x = 1;
diff --git a/tests/misc/mktemp b/tests/misc/mktemp
index 1bef533..40bbe51 100755
--- a/tests/misc/mktemp
+++ b/tests/misc/mktemp
@@ -57,7 +57,7 @@ my @Tests =
      #
      ['too-many', 'a b',
       {ERR=>"$prog: too many templates\n"
-       . "Try `$prog --help' for more information.\n"}, {EXIT => 1} ],
+       . "Try '$prog --help' for more information.\n"}, {EXIT => 1} ],
      ['too-many-q', '-q a b', {EXIT => 1} ],

      ['too-few-x', 'foo.XX', {EXIT => 1},
@@ -164,7 +164,7 @@ my @Tests =
      ['suffix9f', 'aXXXX --suffix=b', {EXIT=>1},
       {ENV=>"POSIXLY_CORRECT=1"},
       {ERR=>"$prog: too many templates\n"
-       . "Try `$prog --help' for more information.\n"}],
+       . "Try '$prog --help' for more information.\n"}],

      ['suffix10f', 'aXXb', {EXIT => 1},
       {ERR=>"$prog: too few X's in template `aXXb'\n"}],
diff --git a/tests/misc/printf-cov b/tests/misc/printf-cov
index 892cb01..c3a6861 100755
--- a/tests/misc/printf-cov
+++ b/tests/misc/printf-cov
@@ -19,7 +19,7 @@
 use strict;

 my $prog = 'printf';
-my $try = "Try \`$prog --help' for more information.\n";
+my $try = "Try '$prog --help' for more information.\n";
 my $pow_2_31 = 2**31;

 # Turn off localization of executable's output.
diff --git a/tests/misc/seq b/tests/misc/seq
index dabdccf..05770b0 100755
--- a/tests/misc/seq
+++ b/tests/misc/seq
@@ -24,7 +24,7 @@ use strict;
 @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;

 my $prog = 'seq';
-my $try_help = "Try `$prog --help' for more information.\n";
+my $try_help = "Try '$prog --help' for more information.\n";

 my $locale = $ENV{LOCALE_FR_UTF8};
 ! defined $locale || $locale eq 'none'
diff --git a/tests/misc/sort-files0-from b/tests/misc/sort-files0-from
index ebabae3..80ad423 100755
--- a/tests/misc/sort-files0-from
+++ b/tests/misc/sort-files0-from
@@ -32,7 +32,7 @@ my @Tests =
    ['f-extra-arg', '--files0-from=- no-such', {IN=>"a"}, {EXIT=>2},
     {ERR => "$prog: extra operand `no-such'\n"
         . "file operands cannot be combined with --files0-from\n"
-        . "Try `$prog --help' for more information.\n"}
+        . "Try '$prog --help' for more information.\n"}
     ],

    # missing input file
diff --git a/tests/misc/tsort b/tests/misc/tsort
index 0bc2a2c..88fcec5 100755
--- a/tests/misc/tsort
+++ b/tests/misc/tsort
@@ -55,7 +55,7 @@ my @Tests =
    ['only-one', {IN => {f => ""}}, {IN => {g => ""}},
     {EXIT => 1},
     {ERR => "tsort: extra operand `g'\n"
-     . "Try `tsort --help' for more information.\n"}],
+     . "Try 'tsort --help' for more information.\n"}],
   );

 my $save_temps = $ENV{DEBUG};
diff --git a/tests/misc/uniq b/tests/misc/uniq
index 5083be5..84e1c48 100755
--- a/tests/misc/uniq
+++ b/tests/misc/uniq
@@ -21,7 +21,7 @@ use strict;
 my $limits = getlimits ();

 my $prog = 'uniq';
-my $try = "Try \`$prog --help' for more information.\n";
+my $try = "Try '$prog --help' for more information.\n";

 # Turn off localization of executable's output.
 @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
diff --git a/tests/misc/wc-files0-from b/tests/misc/wc-files0-from
index 4d21b7b..ac22113 100755
--- a/tests/misc/wc-files0-from
+++ b/tests/misc/wc-files0-from
@@ -32,7 +32,7 @@ my @Tests =
    ['f-extra-arg', '--files0-from=- no-such', {IN=>"a"}, {EXIT=>1},
     {ERR => "$prog: extra operand `no-such'\n"
         . "file operands cannot be combined with --files0-from\n"
-        . "Try `$prog --help' for more information.\n"}
+        . "Try '$prog --help' for more information.\n"}
     ],

    # missing input file
diff --git a/tests/mv/diag b/tests/mv/diag
index f30ba92..c8ba7f3 100755
--- a/tests/mv/diag
+++ b/tests/mv/diag
@@ -36,9 +36,9 @@ mv --target=f2 f1 >> out 2>&1 && fail=1

 cat > exp <<\EOF
 mv: missing file operand
-Try `mv --help' for more information.
+Try 'mv --help' for more information.
 mv: missing destination file operand after `no-file'
-Try `mv --help' for more information.
+Try 'mv --help' for more information.
 mv: target `f1' is not a directory
 mv: target `f2' is not a directory
 EOF
--
1.7.9.rc0.2.g4b783



reply via email to

[Prev in Thread] Current Thread [Next in Thread]