]> thyrsus.com Git - ascii.git/commitdiff
Improved splashscreen.
authorEric S. Raymond <esr@thyrsus.com>
Wed, 12 Nov 1997 21:14:54 +0000 (21:14 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Wed, 12 Nov 1997 21:14:54 +0000 (21:14 +0000)
Makefile
ascii.c
ascii.xml
splashscreen

index 5e52d0cd0f2b0a06116120684e9ff1f91c7ff0f6..09657c93f659c85eb34f7957bfc5b63dc8b0391a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,8 +4,8 @@
 # the RPM spec file and LSM
 V=2.3
 
-ascii.o: ascii.c splashscreen.h
 ascii: ascii.o 
+ascii.o: ascii.c splashscreen.h
 
 splashscreen.h: splashscreen
        sed <splashscreen >splashscreen.h -e 's/\\/\\\\/g' -e 's/"/\\"/' -e 's/.*/P("&");/' 
@@ -13,7 +13,7 @@ splashscreen.h: splashscreen
 CFLAGS = -O
 
 clean:
-       rm -f ascii ascii.tar* ascii.shar
+       rm -f ascii ascii.tar* ascii.shar ascii.o splashscreen.h
 
 SOURCES = Makefile ascii.c ascii.1 ascii.lsm ascii.spec 
 
diff --git a/ascii.c b/ascii.c
index 724ba52ee6a843621f1a7a85d15be6ca1b34f574..5bd8e791d9c84dcfcd810a76f3dab297775019be 100644 (file)
--- a/ascii.c
+++ b/ascii.c
@@ -24,7 +24,7 @@
  */
 
 
-#define REVISION "$Revision: 1.7 $"
+#define REVISION "$Revision: 1.8 $"
 
 #include <unistd.h>
 #include <stdio.h>
@@ -283,28 +283,7 @@ char       *str;
 void 
 showHelp(FILE *out, char *progname) 
 {
-  fprintf(out,"Usage: $ %s    [t]    char-alias...\n",progname); 
-  fprintf(out,"       $ %s    [dxo] \n",progname); 
-  fprintf(out,"Options:\n");
-  fprintf(out,"   -t \t\t  Script-friendly mode with terse output \n");
-  fprintf(out,"   -d \t\t  Ascii table in decimal  \n");
-  fprintf(out,"   -x \t\t  Ascii table in hex      \n");
-  fprintf(out,"   -o \t\t  Ascii table in octal    \n");
-  fprintf(out,"   -h \t\t  This help screen\n");
-  fprintf(out,"   -v \t\t  Version info\n");
-  fprintf(out,"Description:\n");
-  fprintf(out,"Prints all aliases of a given ASCII character.
-Args may be single chars, C escape sequences, English names
-caret escapes for control characters, ASCII mnemonics,
-or numeric values in hex/octal/decimal/binary.\n");
-
-  exit(0);
-}
-
-/*********************************************************/
-void 
-showSplash(void) 
-{
+  fprintf(out,"Usage: %s [-dxohv] [-t] [char-alias...]\n", progname); 
 #define P(s)   puts(s);
 #include "splashscreen.h"
 #undef P
@@ -611,10 +590,8 @@ char **argv;
 
     process_options(argc, argv, optstring) ;
 
-    if (help)
+    if (help || argc == optind)
        showHelp(stdout, argv[0]);
-    else if (argc == optind ) 
-       showSplash();
     else {
        for(argc--, argv++ ; argc > 0; argv++, argc--)
            ascii(*argv) ;
index b5c2bd0ec2916b5272ba89fdb05712bc2c427255..44247007919c9fb0175ff0d1cca0b4b8a2837a62 100644 (file)
--- a/ascii.xml
+++ b/ascii.xml
@@ -2,9 +2,10 @@
 .SH NAME
 ascii -- report character aliases
 .SH SYNOPSIS
-ascii char-alias...
+ascii [-dxohv] [-t] [char-alias...]
 .SH OPTIONS
-A summary of options are included below:
+Called with no options, ascii behaves like `ascii -h'.  Options
+are as follows:
 .TP
 .B \-t
 Script-friendly mode, emits only ISO/decimal/hex/octal/binary
@@ -19,7 +20,7 @@ Ascii table in hex.
 .B \-o
 Ascii table in octal.
 .TP
-.B \-h
+.B \-h, -?
 Show summary of options.
 .TP
 .B \-v
index cae404f92b4710ad6eb361566390e2acd300127a..d18a0f4cd7bb45c57dd69b55084afd640e69908c 100644 (file)
@@ -1,3 +1,8 @@
+   -t = one-line output  -d = Decimal table  -o = octal table  -x = hex table
+   -h = This help screen -v = version information
+Prints all aliases of an ASCII character. Args may be chars, C \-escapes,
+English names, ^-escapes, ASCII mnemonics, or numerics in decimal/octal/hex.
+
 Dec Hex    Dec Hex    Dec Hex  Dec Hex  Dec Hex  Dec Hex   Dec Hex   Dec Hex  
   0 00 NUL  16 10 DLE  32 20    48 30 0  64 40 @  80 50 P   96 60 `  112 70 p
   1 01 SOH  17 11 DC1  33 21 !  49 31 1  65 41 A  81 51 Q   97 61 a  113 71 q