https://bugs.winehq.org/show_bug.cgi?id=54350
--- Comment #3 from Christopher giecrilj@stegny.2a.pl --- (In reply to Olivier F. R. Dierick from comment #1)
Hello,
'where' is currently just a stub program. i.e. it does nothing but print a FIXME with the passed arguments.
Here is something to begin with:
==CODE==
using System; using System .Resources; using System .IO;
class WhereCmd { const String NAME = "WHERE", ARG1 = "[$%{0}%:|%{1}%:]%{2}%[ ...]";
public static int Main (String [] args) { ResourceManager rm = new ResourceManager ("strings", typeof (WhereCmd) .Assembly); if (01 == args .Length) if ("/?" == args [0]) // ?IS_HELP Y { String DIR = rm .GetString ("DIR"), ENV = rm .GetString ("ENV"), PATH = rm .GetString ("PATH"), PATTERN = rm .GetString ("PATTERN");
Console .WriteLine("{0}: {1}", NAME, rm .GetString ("description") );
Console .Write ("{0}: WHERE [/R %{1}%] [/Q] [/F] [/T] ", rm .GetString ("syntax"), DIR); Console .WriteLine (ARG1, ENV, PATH, PATTERN);
Console .WriteLine ("{0}:", rm .GetString ("parameters")); foreach (char o in "RQFT1?") if ('1' == o) // ?IS_1 Y { Console .Write (ARG1, ENV, PATH, PATTERN); Console .Write ("\t"); Console .WriteLine (rm .GetString ("1.HELP"), ENV, PATH, PATTERN); }
else // ?IS_1 N { Console .WriteLine ( "/{0}\t{1}", o, rm .GetString (String .Format ("{0}.HELP", '?' == o ? (object) null : o))); }
// ?IS_1 }
else // ?IS_HELP N { string [] exts = Environment .GetEnvironmentVariable ("PATHEXT") .Split (Path .PathSeparator);
foreach ( string p in Environment .GetEnvironmentVariable ("PATH") .Split (Path .PathSeparator)) foreach (string e in exts) { string x = Path .ChangeExtension (Path .Combine (p, args [0]), e);
if (File .Exists (x)) Console .WriteLine (x); }} // ?IS_HELP return 0; }}
==RESOURCES==
description=Displays the location of files that match the given search pattern. syntax=SYNTAX DIR=DIR ENV=ENV PATH=PATH PATTERN=PATTERN parameters=Parameters R.HELP=Indicates a recursive search, starting with the specified directory. Q.HELP=Returns an exit code (0 for success, 1 for failure) without displaying the list of matched files. F.HELP=Displays the results of the where command in quotation marks. T.HELP=Displays the file size and the last modified date and time of each matched file. 1.HELP=Specifies the search pattern for the files to match. At least one pattern is required, and the pattern can include wildcard characters (* and ?). By default, where searches the current directory and the paths that are specified in the PATH environment variable. You can specify a different path to search by using the format $%{0}%:%{2}% (where %{0}% is an existing environment variable containing one or more paths) or by using the format %{1}%:%{2}% (where %{1}% is the directory path you want to search). These optional formats should not be used with the /r command-line option. .HELP=Displays help at the command prompt.
Regards.