- initial changes to data shapes
- ls command needs fixing
This commit is contained in:
+16
-6
@@ -11,14 +11,22 @@ import { convertToUnit } from "@termos/util/format_unit";
|
||||
|
||||
export const COMMAND_NAME = "ls";
|
||||
|
||||
async function main(
|
||||
io: CommandIO,
|
||||
state: ShellState,
|
||||
flags: string[],
|
||||
args: string[],
|
||||
): Promise<CommandOutput<ShellError>> {
|
||||
async function main(io: CommandIO, state: ShellState, args: string[]): Promise<CommandOutput<ShellError>> {
|
||||
const entries: { inode: number; path: string }[] = [];
|
||||
const e = new TextEncoder();
|
||||
|
||||
const flags: Set<string> = new Set();
|
||||
|
||||
for (const arg of args) {
|
||||
if (arg.startsWith("--")) {
|
||||
arg.slice(2);
|
||||
flags.add(arg);
|
||||
} else if (arg.startsWith("-")) {
|
||||
arg.slice(1);
|
||||
flags.add(arg);
|
||||
}
|
||||
}
|
||||
|
||||
const vars = flags.filter(
|
||||
// Match at least 1 character between each side of a singular = character
|
||||
f =>
|
||||
@@ -238,6 +246,8 @@ function longMode(io: CommandIO, state: ShellState, nodes: TreeNode[], flags: Se
|
||||
}
|
||||
}
|
||||
|
||||
function parseFlags() {}
|
||||
|
||||
function parseMode(mode: number) {
|
||||
const owner = (mode >> 6) & 7;
|
||||
const group = (mode >> 3) & 7;
|
||||
|
||||
Reference in New Issue
Block a user