diff options
author | Jim Meyering <jim@meyering.net> | 1999-03-04 05:36:10 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-03-04 05:36:10 +0000 |
commit | 88cbad981787d34f3dc8118bde16416c12a50421 (patch) | |
tree | 1a8993c9e22726767a534efd76dd619bfc80752d /src/cksum.c | |
parent | 0ae96f236175101ddc6c8f0eaf46d08f88173486 (diff) | |
download | coreutils-88cbad981787d34f3dc8118bde16416c12a50421.tar.xz |
Include long-options.h
[long_options]: Remove the "help" and "version" entries.
Remove declarations of show_help and show_version.
(main): Use parse_long_options, including author name(s).
Remove the show_version and show_help blocks.
Diffstat (limited to 'src/cksum.c')
-rw-r--r-- | src/cksum.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/src/cksum.c b/src/cksum.c index 01aba44e5..6d67585d9 100644 --- a/src/cksum.c +++ b/src/cksum.c @@ -12,8 +12,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Written by Q. Frank Xia, qx@math.columbia.edu. Cosmetic changes and reorganization by David MacKenzie, djm@gnu.ai.mit.edu. @@ -108,6 +108,7 @@ main () # include <getopt.h> # include <sys/types.h> # include "system.h" +# include "long-options.h" # include "error.h" /* Number of bytes to read at once. */ @@ -116,16 +117,8 @@ main () /* The name this program was run with. */ char *program_name; -/* If nonzero, display usage information and exit. */ -static int show_help; - -/* If nonzero, print the version on standard output then exit. */ -static int show_version; - static struct option const long_options[] = { - {"help", no_argument, &show_help, 1}, - {"version", no_argument, &show_version, 1}, {0, 0, 0, 0} }; @@ -294,6 +287,9 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); + parse_long_options (argc, argv, "cksum", GNU_PACKAGE, VERSION, + "Q. Frank Xia", usage); + have_read_stdin = 0; while ((c = getopt_long (argc, argv, "", long_options, NULL)) != -1) @@ -308,15 +304,6 @@ main (int argc, char **argv) } } - if (show_version) - { - printf ("cksum (%s) %s\n", GNU_PACKAGE, VERSION); - exit (EXIT_SUCCESS); - } - - if (show_help) - usage (0); - if (optind >= argc) { if (cksum ("-", 0) < 0) |