Enhance CLI tool with usage rendering and indented output formatting. Update user prompt for improved clarity and adjust verbosity settings. Modify file listing to return JSON strings for consistent output.
This commit is contained in:
@@ -160,7 +160,7 @@ export async function run(args) {
|
||||
if (!includeHidden && fileName.startsWith(".")) {
|
||||
return { cwd, files: [] };
|
||||
}
|
||||
return { cwd, files: [[fileName, "f", stat.size]] };
|
||||
return { cwd, files: JSON.stringify([[fileName, 'f', stat.size]]) };
|
||||
}
|
||||
|
||||
// Handle non-directory case
|
||||
@@ -173,7 +173,7 @@ export async function run(args) {
|
||||
const files = await listEntriesRecursive(resolvedBase, chrootResolved, depth === -1 ? Infinity : depth, includeHidden);
|
||||
return {
|
||||
cwd,
|
||||
files: files.sort((a, b) => a[0].localeCompare(b[0])), // Sort for consistent output
|
||||
files: JSON.stringify(files.sort((a, b) => a[0].localeCompare(b[0]))), // Sort for consistent output
|
||||
};
|
||||
} catch (err) {
|
||||
return { err: `Failed to list files: ${err?.message || String(err)}` };
|
||||
|
||||
Reference in New Issue
Block a user