Changeset 3140 for trunk/src/kmk/getopt.c
- Timestamp:
- Mar 14, 2018, 10:28:10 PM (7 years ago)
- Location:
- trunk/src/kmk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk
-
Property svn:mergeinfo
set to
/vendor/gnumake/current merged eligible
-
Property svn:mergeinfo
set to
-
trunk/src/kmk/getopt.c
r2591 r3140 4 4 before changing it! 5 5 6 Copyright (C) 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 7 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 8 2010 Free Software Foundation, Inc. 6 Copyright (C) 1987-2016 Free Software Foundation, Inc. 9 7 10 8 NOTE: The canonical source of this file is maintained with the GNU C Library. … … 84 82 85 83 86 /* This version of `getopt' appears to the caller like standard Unix `getopt'84 /* This version of `getopt' appears to the caller like standard Unix 'getopt' 87 85 but it behaves differently for the user, since it allows the user 88 86 to intersperse the options with the other arguments. … … 202 200 # endif 203 201 202 #ifndef KMK 204 203 /* Avoid depending on library functions or files 205 204 whose names are inconsistent. */ 206 207 205 #ifndef getenv 208 206 extern char *getenv (); 209 207 #endif 208 #endif /* !KMK */ 210 209 211 210 static char * … … 662 661 { 663 662 if (opterr) 664 fprintf (stderr, _("%s: option `%s' is ambiguous\n"),663 fprintf (stderr, _("%s: option '%s' is ambiguous\n"), 665 664 argv[0], argv[optind]); 666 665 nextchar += strlen (nextchar); … … 683 682 { 684 683 if (opterr) 685 { 686 687 688 689 _("%s: option `--%s' doesn't allow an argument\n"),690 691 692 693 694 _("%s: option `%c%s' doesn't allow an argument\n"),695 696 684 { /* bird: disambiguate */ 685 if (argv[optind - 1][1] == '-') 686 /* --option */ 687 fprintf (stderr, 688 _("%s: option '--%s' doesn't allow an argument\n"), 689 argv[0], pfound->name); 690 else 691 /* +option or -option */ 692 fprintf (stderr, 693 _("%s: option '%c%s' doesn't allow an argument\n"), 694 argv[0], argv[optind - 1][0], pfound->name); 695 } 697 696 698 697 nextchar += strlen (nextchar); … … 710 709 if (opterr) 711 710 fprintf (stderr, 712 _("%s: option `%s' requires an argument\n"),711 _("%s: option '%s' requires an argument\n"), 713 712 argv[0], argv[optind - 1]); 714 713 nextchar += strlen (nextchar); … … 739 738 if (argv[optind][1] == '-') 740 739 /* --option */ 741 fprintf (stderr, _("%s: unrecognized option `--%s'\n"),740 fprintf (stderr, _("%s: unrecognized option '--%s'\n"), 742 741 argv[0], nextchar); 743 742 else 744 743 /* +option or -option */ 745 fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),744 fprintf (stderr, _("%s: unrecognized option '%c%s'\n"), 746 745 argv[0], argv[optind][0], nextchar); 747 746 } … … 849 848 { 850 849 if (opterr) 851 fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),850 fprintf (stderr, _("%s: option '-W %s' is ambiguous\n"), 852 851 argv[0], argv[optind]); 853 852 nextchar += strlen (nextchar); … … 868 867 if (opterr) 869 868 fprintf (stderr, _("\ 870 %s: option `-W %s' doesn't allow an argument\n"),869 %s: option '-W %s' doesn't allow an argument\n"), 871 870 argv[0], pfound->name); 872 871 … … 883 882 if (opterr) 884 883 fprintf (stderr, 885 _("%s: option `%s' requires an argument\n"),884 _("%s: option '%s' requires an argument\n"), 886 885 argv[0], argv[optind - 1]); 887 886 nextchar += strlen (nextchar); … … 1010 1009 1011 1010 case 'c': 1012 printf ("option c with value `%s'\n", optarg);1011 printf ("option c with value '%s'\n", optarg); 1013 1012 break; 1014 1013
Note:
See TracChangeset
for help on using the changeset viewer.