Here is a mostly cosmetic change for cygpath. I organized the usage
output so that it is more clear (to me) that the -ADHPSW options do
not require an argument. I also changed the desciption for --help
to 'output usage' from 'print this help' since the latter looks mighty
silly on the web or man page.
The only non-cosmetic part is an attempted fix for the new
'--type mixed' option. I have to confess that I don't understand how the
'--type dos' option is different from --windows, or why '--type mixed'
is a better solution than a --mixed option. I'm CC'ing the author of
that patch so perhaps he can enlighten us if not already reading this
mailing list. In any case, however,
the -ADHPSW options should respect the new option and I think these
two lines of code will do it. I'm still not able to compile the utils
right now, though, so that code is untested.
ChangeLog:
2002-06-18 Joshua Daniel Franklin <[EMAIL PROTECTED]>
* cygpath.cc (usage): Clean up usage output.
(dowin): Correct output of -t mixed for -ADHPSW options.
--- cygpath.cc-orig Tue Jun 18 19:33:22 2002
+++ cygpath.cc Tue Jun 18 20:00:43 2002
@@ -60,29 +60,33 @@ usage (FILE * stream, int status)
{
if (!ignore_flag || !status)
fprintf (stream, "\
-Usage: %s (-u|--unix)|(-w|--windows) [options] filename\n\n\
- -u|--unix print Unix form of filename\n\
- -w|--windows print Windows form of filename\n\n\
-Other options:\n\
- -a|--absolute output absolute path\n\
- -c|--close handle close handle (for use in captured process)\n\
- -f|--file file read file for input path information\n\
- -i|--ignore ignore missing argument\n\
- -l|--long-name print Windows long form of filename (with -w only)\n\
- -p|--path filename argument is a path\n\
- -s|--short-name print Windows short form of filename (with -w only)\n\
- -t|--type print Windows form of filename with specified\n\
+Usage: %s (-u|-w|-t TYPE) [-c HANDLE] [-f FILE] [options] NAME\n\n\
+ %s [-ADHPSW] \n\n\
+Output type options (required):\n\
+ -u|--unix print Unix form of NAME (default)\n\
+ -w|--windows print Windows form of NAME \n\n\
+ -t|--type print Windows form of NAME with TYPE one of\n\
dos drive letter with backslashes (C:\\WINNT)\n\
mixed drive letter with regular slashes (C:/WINNT)\n\
+Path conversion options:\n\
+ -a|--absolute output absolute path\n\
+ -c|--close HANDLE close HANDLE (for use in captured process)\n\
+ -f|--file FILE read FILE for input; use - to read from STDIN\n\
+ -i|--ignore ignore missing argument\n\
+ -l|--long-name print Windows long form of NAME (with -w only)\n\
+ -p|--path NAME is a PATH list (i.e., '/bin:/usr/bin')\n\
+ -s|--short-name print Windows short form of NAME (with -w only)\n\
+System information output:\n\
-A|--allusers use `All Users' instead of current user for -D, -P\n\
-D|--desktop output `Desktop' directory and exit\n\
-H|--homeroot output `Profiles' directory (home root) and exit\n\
-P|--smprograms output Start Menu `Programs' directory and exit\n\
-S|--sysdir output system directory and exit\n\
-W|--windir output `Windows' directory and exit\n\n\
-Informative output:\n\
- -h|--help print this help, then exit\n\
- -v|--version output version information and exit\n", prog_name);
+Other options:\n\
+ -h|--help output usage information and exit\n\
+ -v|--version output version information and exit\n\
+ ", prog_name, prog_name);
exit (ignore_flag ? 0 : status);
}
@@ -373,6 +377,8 @@ dowin (char option)
{
if (shortname_flag)
buf = get_short_name (buf);
+ if (mixed_flag)
+ buf = get_mixed_name (buf);
}
printf ("%s\n", buf);
exit (0);