log.debug("done");
return;
}
BufferObjectWriter oout = new BufferObjectWriter(getStdOut());
VFS vfs = shell.getVFS();
FileName pwd = new FileName(shell.getEnvProperty("PWD"));
String out = OUTPUT_STRING;
boolean output = false; // was out param already processed
boolean longOut = false;
boolean rslvLinks = true;
// boolean help = false;
List paths = new LinkedList();
for (int i = 0; i < params.length; i++) {
String param = params[i];
if (!longOut && param.equals(OPTION_LONG))
longOut = true;
else if (!output && param.startsWith(OUTPUT)) {
out = param.substring(OUTPUT.length());
output = true;
}
/* else if (param.equals(HELP)) {
help = true;
oout.writeObject("Usage: ls [--help] [-ex] [-out=OUTPUT] [-l] [--help]\n");
oout.writeObject(" OUTPUT = string | filename | fileinfo; String is default.\n");
oout.writeObject(" -l = long output; Makes difference only with -out=string.\n");
oout.writeObject(" --help = Prints this.\n");
oout.close();
System.out.println("[LsExe] : done.");
return;
}
*/
else {
FileName path = new FileName(param);
if (path.isRelative())
path = pwd.absolutize(path);
// path = vfs.resolve(shell.getUserCtx(), path, true);
paths.add(path);
}
}
// if no paths given, list working dir
if (paths.isEmpty())
paths.add(pwd);
// now we have all paths resolved and absolute in FileName form in the 'paths' list
//log.debug("Paths: " + paths);
List expPaths = new LinkedList();
Iterator it = paths.iterator();
while (it.hasNext()) {
FileName filename = (FileName) it.next();
List children = vfs.list(shell.getUserCtx(), filename, !rslvLinks);
//log.debug("Expanding children: " + children);
expPaths.addAll(children);
}
paths = expPaths;