* cygpath.cc: add --windir/--sysdir options
* utils.sgml: and document them
This commit is contained in:
parent
f343a326d3
commit
f00c1d2ccd
|
@ -1,3 +1,8 @@
|
||||||
|
2000-05-19 DJ Delorie <dj@cygnus.com>
|
||||||
|
|
||||||
|
* cygpath.cc: add --windir/--sysdir options
|
||||||
|
* utils.sgml: and document them
|
||||||
|
|
||||||
Thu May 18 14:38:26 2000 Christopher Faylor <cgf@cygnus.com>
|
Thu May 18 14:38:26 2000 Christopher Faylor <cgf@cygnus.com>
|
||||||
|
|
||||||
* Makefile.in: Eliminate WINSUP_DEPS.
|
* Makefile.in: Eliminate WINSUP_DEPS.
|
||||||
|
|
|
@ -35,6 +35,8 @@ static struct option long_options[] =
|
||||||
{ (char *) "file", required_argument, (int *) &file_arg, 'f'},
|
{ (char *) "file", required_argument, (int *) &file_arg, 'f'},
|
||||||
{ (char *) "version", no_argument, NULL, 'v' },
|
{ (char *) "version", no_argument, NULL, 'v' },
|
||||||
{ (char *) "windows", no_argument, NULL, 'w' },
|
{ (char *) "windows", no_argument, NULL, 'w' },
|
||||||
|
{ (char *) "windir", no_argument, NULL, 'W' },
|
||||||
|
{ (char *) "sysdir", no_argument, NULL, 'S' },
|
||||||
{ 0, no_argument, 0, 0 }
|
{ 0, no_argument, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -48,6 +50,8 @@ Usage: %s [-p|--path] (-u|--unix)|(-w|--windows) filename\n\
|
||||||
-f|--file file read file for path information\n\
|
-f|--file file read file for path information\n\
|
||||||
-u|--unix print Unix form of filename\n\
|
-u|--unix print Unix form of filename\n\
|
||||||
-w|--windows print Windows form of filename\n\
|
-w|--windows print Windows form of filename\n\
|
||||||
|
-W|--windir print `Windows' directory\n\
|
||||||
|
-S|--sysdir print `system' directory\n\
|
||||||
-p|--path filename argument is a path\n",
|
-p|--path filename argument is a path\n",
|
||||||
prog_name);
|
prog_name);
|
||||||
exit (status);
|
exit (status);
|
||||||
|
@ -115,6 +119,7 @@ main (int argc, char **argv)
|
||||||
int c;
|
int c;
|
||||||
int options_from_file_flag;
|
int options_from_file_flag;
|
||||||
char *filename;
|
char *filename;
|
||||||
|
char buf[MAX_PATH], buf2[MAX_PATH];
|
||||||
|
|
||||||
prog_name = strrchr (argv[0], '/');
|
prog_name = strrchr (argv[0], '/');
|
||||||
if (prog_name == NULL)
|
if (prog_name == NULL)
|
||||||
|
@ -126,7 +131,7 @@ main (int argc, char **argv)
|
||||||
unix_flag = 0;
|
unix_flag = 0;
|
||||||
windows_flag = 0;
|
windows_flag = 0;
|
||||||
options_from_file_flag = 0;
|
options_from_file_flag = 0;
|
||||||
while ((c = getopt_long (argc, argv, (char *) "hac:f:opuvw", long_options, (int *) NULL))
|
while ((c = getopt_long (argc, argv, (char *) "hac:f:opSuvwW", long_options, (int *) NULL))
|
||||||
!= EOF)
|
!= EOF)
|
||||||
{
|
{
|
||||||
switch (c)
|
switch (c)
|
||||||
|
@ -163,13 +168,25 @@ main (int argc, char **argv)
|
||||||
windows_flag = 1;
|
windows_flag = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'W':
|
||||||
|
GetWindowsDirectory(buf, MAX_PATH);
|
||||||
|
cygwin_conv_to_posix_path(buf, buf2);
|
||||||
|
printf("%s\n", buf2);
|
||||||
|
exit(0);
|
||||||
|
|
||||||
|
case 'S':
|
||||||
|
GetSystemDirectory(buf, MAX_PATH);
|
||||||
|
cygwin_conv_to_posix_path(buf, buf2);
|
||||||
|
printf("%s\n", buf2);
|
||||||
|
exit(0);
|
||||||
|
|
||||||
case 'h':
|
case 'h':
|
||||||
usage (stdout, 0);
|
usage (stdout, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'v':
|
case 'v':
|
||||||
printf ("Cygwin pathconv version 1.0\n");
|
printf ("Cygwin pathconv version 1.0\n");
|
||||||
printf ("Copyright 1998 Cygnus Solutions\n");
|
printf ("Copyright 1998,1999,2000 Cygnus Solutions\n");
|
||||||
exit (0);
|
exit (0);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -66,10 +66,13 @@ or if you know what everything is already, just leave this out.</para>
|
||||||
<screen>
|
<screen>
|
||||||
Usage: cygpath [-p|--path] (-u|--unix)|(-w|--windows) filename
|
Usage: cygpath [-p|--path] (-u|--unix)|(-w|--windows) filename
|
||||||
cygpath [-v|--version]
|
cygpath [-v|--version]
|
||||||
|
cygpath [-W|--windir|-S|--sysdir]
|
||||||
-u|--unix print UNIX form of filename
|
-u|--unix print UNIX form of filename
|
||||||
-w|--windows print Windows form of filename
|
-w|--windows print Windows form of filename
|
||||||
-p|--path filename argument is a path
|
-p|--path filename argument is a path
|
||||||
-v|--version print program version
|
-v|--version print program version
|
||||||
|
-W|--windir print windows directory
|
||||||
|
-S|--sysdir print system directory
|
||||||
</screen>
|
</screen>
|
||||||
|
|
||||||
<para>The <command>cygpath</command> program is a utility that
|
<para>The <command>cygpath</command> program is a utility that
|
||||||
|
|
Loading…
Reference in New Issue