Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. YORUICHI:coreutils-5.0 kitty$ cat src/false.c
  2. /* Exit with a status code indicating failure.
  3. Copyright (C) 1999-2003 Free Software Foundation, Inc.
  4.  
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2, or (at your option)
  8. any later version.
  9.  
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software Foundation,
  17. Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
  18.  
  19. #include <config.h>
  20. #include <stdio.h>
  21. #include <sys/types.h>
  22. #include "system.h"
  23. #include "version-etc.h"
  24. #include "closeout.h"
  25.  
  26. #define PROGRAM_NAME "false"
  27. #define AUTHORS "Jim Meyering"
  28.  
  29. /* The name this program was run with. */
  30. char *program_name;
  31.  
  32. void
  33. usage (int status)
  34. {
  35. printf (_("\
  36. Usage: %s [ignored command line arguments]\n\
  37. or: %s OPTION\n\
  38. Exit with a status code indicating failure.\n\
  39. \n\
  40. These option names may not be abbreviated.\n\
  41. \n\
  42. "),
  43. program_name, program_name);
  44. fputs (HELP_OPTION_DESCRIPTION, stdout);
  45. fputs (VERSION_OPTION_DESCRIPTION, stdout);
  46. printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
  47. exit (status);
  48. }
  49.  
  50. int
  51. main (int argc, char **argv)
  52. {
  53. program_name = argv[0];
  54. setlocale (LC_ALL, "");
  55. bindtextdomain (PACKAGE, LOCALEDIR);
  56. textdomain (PACKAGE);
  57.  
  58. atexit (close_stdout);
  59.  
  60. /* Recognize --help or --version only if it's the only command-line
  61. argument and if POSIXLY_CORRECT is not set. */
  62. if (argc == 2 && getenv ("POSIXLY_CORRECT") == NULL)
  63. {
  64. if (STREQ (argv[1], "--help"))
  65. usage (EXIT_FAILURE);
  66.  
  67. if (STREQ (argv[1], "--version"))
  68. version_etc (stdout, PROGRAM_NAME, GNU_PACKAGE, VERSION, AUTHORS);
  69. }
  70.  
  71. exit (EXIT_FAILURE);
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement