/* Exit with a status code indicating success. This is the true utility
Copyright (C) 1999-2018 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
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, see <https://www.gnu.org/licenses/>. */ The GNUv3 license
#include <config.h> Provides system specific information
#include <stdio.h> Provides standard I/O capability
#include <sys/types.h> Provides system data types
#include "system.h" ...!includes auto-comment...
/* Act like "true" by default; false.c overrides this. */
#ifndef EXIT_STATUS Line 23
# define EXIT_STATUS EXIT_SUCCESS Line 24
#endif Line 25
#if EXIT_STATUS == EXIT_SUCCESS Line 27
# define PROGRAM_NAME "true" Line 28
#else Line 29
# define PROGRAM_NAME "false" Line 30
#endif Line 31
#define AUTHORS proper_name ("Jim Meyering") Line 33
void Line 35
usage (int status) Line 36
{
printf (_("\ Line 38
Usage: %s [ignored command line arguments]\n\ Line 39
or: %s OPTION\n\ Line 40
"), Line 41
program_name, program_name); Line 42
printf ("%s\n\n", Line 43
_(EXIT_STATUS == EXIT_SUCCESS Line 44
? N_("Exit with a status code indicating success.") Line 45
: N_("Exit with a status code indicating failure."))); Line 46
fputs (HELP_OPTION_DESCRIPTION, stdout); Line 47
fputs (VERSION_OPTION_DESCRIPTION, stdout); Line 48
printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME); Line 49
emit_ancillary_info (PROGRAM_NAME); Line 50
exit (status); Line 51
} Block 1
int
main (int argc, char **argv) Line 55
{
/* Recognize --help or --version only if it's the only command-line
argument. */
if (argc == 2) Line 59
{
initialize_main (&argc, &argv); VMS-specific entry point handling wildcard expansion
set_program_name (argv[0]); Retains program name and discards path
setlocale (LC_ALL, ""); Sets up internationalization (i18n)
bindtextdomain (PACKAGE, LOCALEDIR); Assigns i18n directorySets text domain for _() [gettext()] function
textdomain (PACKAGE); Sets text domain for _() [gettext()] function
/* Note true(1) will return EXIT_FAILURE in the
edge case where writes fail with GNU specific options. */
atexit (close_stdout); Close stdout on exit (see gnulib)
if (STREQ (argv[1], "--help")) Line 71
usage (EXIT_STATUS); Line 72
if (STREQ (argv[1], "--version")) Line 74
version_etc (stdout, PROGRAM_NAME, PACKAGE_NAME, Version, AUTHORS, Line 75
(char *) NULL); Line 76
}
return EXIT_STATUS; Line 79
}