gnulib-tool: Highlight the changed options.
authorBruno Haible <bruno@clisp.org>
Sun, 5 Sep 2010 09:28:47 +0000 (11:28 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 7 Sep 2010 08:29:51 +0000 (10:29 +0200)
* gnulib-tool (func_usage): Display the --import, --add-import,
--remove-import explanations in bold font.

ChangeLog
gnulib-tool

index 21f499b..4d27d6a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-09-05  Bruno Haible  <bruno@clisp.org>
+
+       gnulib-tool: Highlight the changed options.
+       * gnulib-tool (func_usage): Display the --import, --add-import,
+       --remove-import explanations in bold font.
+
 2010-09-06  Karl Berry  <karl@gnu.org>
 
        * doc/gnulib-tool.texi (Modified imports): doc tweaks.
index 78828e5..28d5b69 100755 (executable)
@@ -123,12 +123,24 @@ fi
 # outputs to stdout the --help usage message.
 func_usage ()
 {
+  # This use of bold display can be removed on 2011-01-01.
+  if case "$TERM" in
+       xterm*) test -t 1;;
+       *) false;;
+     esac; then
+    # Assume xterm compatible escape sequences.
+    bold_on=`printf '\x1b[1m'`
+    bold_off=`printf '\x1b[0m'`
+  else
+    bold_on=
+    bold_off=
+  fi
   echo "\
 Usage: gnulib-tool --list
-       gnulib-tool --find filename
+       gnulib-tool --find filename${bold_on}
        gnulib-tool --import [module1 ... moduleN]
        gnulib-tool --add-import [module1 ... moduleN]
-       gnulib-tool --remove-import [module1 ... moduleN]
+       gnulib-tool --remove-import [module1 ... moduleN]${bold_off}
        gnulib-tool --update
        gnulib-tool --create-testdir --dir=directory [module1 ... moduleN]
        gnulib-tool --create-megatestdir --dir=directory [module1 ... moduleN]
@@ -152,14 +164,14 @@ Usage: gnulib-tool --list
 
 Operation modes:
       --list                print the available module names
-      --find                find the modules which contain the specified file
+      --find                find the modules which contain the specified file${bold_on}
       --import              import the given modules into the current package
       --add-import          augment the list of imports from gnulib into the
                             current package, by adding the given modules;
                             if no modules are specified, update the current
                             package from the current gnulib
       --remove-import       reduce the list of imports from gnulib into the
-                            current package, by removing the given modules
+                            current package, by removing the given modules${bold_off}
       --update              update the current package, restore files omitted
                             from version control
       --create-testdir      create a scratch package with the given modules