* cygpath.cc (usage): Change usage output slightly.

* cygpath.cc (main): Add option l to support conversion to
	Windows long file names.  Refactured code for capital options.
	Support of options from file for capital options.
	(dowin): New function.  Refactured from main.
	(doit): Call long path conversion.
	(get_long_name): New function.
	(get_long_paths): New function.
	(get_long_path_name_w32impl): New function.  Reimplementation
	of Windows API function GetLongPathName (only 98/Me/2000/XP or
	higher).
	(get_short_name): Call GetShortPathName only once.
	(get_short_paths): Fix calculating buffer size.
	* utils.sgml: Update cygpath section for l option.
This commit is contained in:
Corinna Vinschen
2002-05-22 10:05:41 +00:00
parent 6acce4b8bd
commit 5bb52de4e2
3 changed files with 303 additions and 105 deletions

View File

@@ -71,18 +71,22 @@ or if you know what everything is already, just leave this out.</para>
<sect2 id="cygpath"><title>cygpath</title>
<screen>
Usage: cygpath.exe [-p|--path] (-u|--unix)|(-w|--windows [-s|--short-name]) filename
Usage: cygpath [-p|--path] (-w|--windows) ([-s|--short-name]|[-l|--long-name]) filename
Usage: cygpath [-p|--path] (-u|--unix) filename
Usage: cygpath (-H|--homeroot)|(-S|--sysdir)|(-W|--windir) [-s|--short-name]
Usage: cygpath [-A|--allusers] (-D|--desktop)|(-P|--smprograms) [-s|--short-name]
-a|--absolute output absolute path
-c|--close handle close handle (for use in captured process)
-f|--file file read file for input path information
-i|--ignore ignore missing argument
-l|--long-name print Windows long form of filename
-p|--path filename argument is a path
-s|--short-name print Windows short form of filename
-u|--unix print Unix form of filename
-v|--version output version information and exit
-w|--windows print Windows form of filename
-A|--allusers use `All Users' instead of current user for -D, -P
-H|--homeroot output `Profiles' directory (home root) and exit\n\
-H|--homeroot output `Profiles' directory (home root) and exit
-D|--desktop output `Desktop' directory and exit
-P|--smprograms output Start Menu `Programs' directory and exit
-S|--sysdir output system directory and exit
@@ -102,8 +106,14 @@ indicate whether you want a conversion from Windows to UNIX (POSIX)
format (<literal>-u</literal>) or a conversion from UNIX (POSIX) to
Windows format (<literal>-w</literal>). You must give exactly
one of these. To give neither or both is an error. Use the
<literal>-s</literal> option in combination with the <literal>-w
</literal> option to convert to Windows short form.</para>
<literal>-l</literal> or <literal>-s</literal> option in combination
with the <literal>-w</literal> option to convert to Windows long or
short form.</para>
<para>Caveat: The <literal>-l</literal> option does not work if the
<em>check_case</em> parameter of <em>CYGWIN</em> is set to <em>strict</em>,
since Cygwin is not able to match any Windows short path in this mode.
</para>
<para>The <literal>-p</literal> option means that you want to convert
a path-style string rather than a single filename. For example, the