implement shell command interface and add basic commands (echo, ls, pwd, cd, touch, cat, rm) with syscall integration
All checks were successful
Master Build / Build and Push Docker Image (amd64) (push) Successful in 53s
Master Build / Update running container (push) Successful in 52s

This commit is contained in:
2025-01-23 15:22:42 -03:00
parent 2817165386
commit f39333cae6
18 changed files with 519 additions and 46 deletions

24
src/shell/commands/rm.ts Normal file
View File

@@ -0,0 +1,24 @@
import { IShellCommand } from "./IShellCommand";
import { ShellSyscall } from "../ShellSyscall";
export class rm implements IShellCommand {
private syscall: ShellSyscall;
constructor(syscall: ShellSyscall) {
this.syscall = syscall;
}
getName(): string {
return "rm";
}
execute(args: string[]): string {
if (args.length < 1) {
return "Usage: rm <filename>";
}
const filename = args[0];
this.syscall.deleteFile(filename);
return `Removed ${filename}`;
}
}