From c33fef67f8f1278a9e79f603058af5ea44800b4f Mon Sep 17 00:00:00 2001 From: charnier Date: Mon, 30 Jun 1997 06:45:53 +0000 Subject: Add usage string. Typo in man page. --- usr.bin/ctags/ctags.1 | 2 +- usr.bin/ctags/ctags.c | 23 ++++++++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) (limited to 'usr.bin/ctags') diff --git a/usr.bin/ctags/ctags.1 b/usr.bin/ctags/ctags.1 index c8b7fad..d11dbbd 100644 --- a/usr.bin/ctags/ctags.1 +++ b/usr.bin/ctags/ctags.1 @@ -84,7 +84,7 @@ that take arguments are tagged automatically. .It Fl f Places the tag descriptions in a file called .Ar tagsfile . -The default behavior is to place them in a file called +The default behaviour is to place them in a file called .Ar tags . .It Fl t create tags for typedefs, structs, unions, and enums. diff --git a/usr.bin/ctags/ctags.c b/usr.bin/ctags/ctags.c index 3c6464b..725dfb5 100644 --- a/usr.bin/ctags/ctags.c +++ b/usr.bin/ctags/ctags.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1987, 1993, 1994 + * Copyright (c) 1987, 1993, 1994, 1995 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,12 +33,12 @@ #ifndef lint static char copyright[] = -"@(#) Copyright (c) 1987, 1993, 1994\n\ +"@(#) Copyright (c) 1987, 1993, 1994, 1995\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #ifndef lint -static char sccsid[] = "@(#)ctags.c 8.3 (Berkeley) 4/2/94"; +static char sccsid[] = "@(#)ctags.c 8.4 (Berkeley) 2/7/95"; #endif /* not lint */ #include @@ -77,6 +77,7 @@ char lbuf[LINE_MAX]; void init __P((void)); void find_entries __P((char *)); +static void usage __P((void)); int main(argc, argv) @@ -125,15 +126,12 @@ main(argc, argv) break; case '?': default: - goto usage; + usage(); } argv += optind; argc -= optind; - if (!argc) { -usage: (void)fprintf(stderr, - "usage: ctags [-BFadtuwvx] [-f tagsfile] file ...\n"); - exit(1); - } + if (!argc) + usage(); init(); @@ -175,6 +173,13 @@ usage: (void)fprintf(stderr, exit(exit_val); } +static void +usage() +{ + (void)fprintf(stderr, "usage: ctags [-BFadtuwvx] [-f tagsfile] file ...\n"); + exit(1); +} + /* * init -- * this routine sets up the boolean psuedo-functions which work by -- cgit v1.1