mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-16 15:53:03 +00:00
(getargs): Use EXIT_FAILURE and EXIT_SUCCESS rather than 1 and 0.
Remove duplicate code for "Try `bison --help'". (usage): Add __attribute__((__noreturn__)).
This commit is contained in:
@@ -155,6 +155,8 @@ report_argmatch (char *args)
|
|||||||
| Display the help message and exit STATUS. |
|
| Display the help message and exit STATUS. |
|
||||||
`-------------------------------------------*/
|
`-------------------------------------------*/
|
||||||
|
|
||||||
|
static void usage (int) ATTRIBUTE_NORETURN;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
usage (int status)
|
usage (int status)
|
||||||
{
|
{
|
||||||
@@ -337,11 +339,11 @@ getargs (int argc, char *argv[])
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'h':
|
case 'h':
|
||||||
usage (0);
|
usage (EXIT_SUCCESS);
|
||||||
|
|
||||||
case 'V':
|
case 'V':
|
||||||
version ();
|
version ();
|
||||||
exit (0);
|
exit (EXIT_SUCCESS);
|
||||||
|
|
||||||
case 'g':
|
case 'g':
|
||||||
/* Here, the -g and --graph=FILE options are differentiated. */
|
/* Here, the -g and --graph=FILE options are differentiated. */
|
||||||
@@ -405,9 +407,7 @@ getargs (int argc, char *argv[])
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fprintf (stderr, _("Try `%s --help' for more information.\n"),
|
usage (EXIT_FAILURE);
|
||||||
program_name);
|
|
||||||
exit (1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argc - optind != 1)
|
if (argc - optind != 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user