From 5f183d4a0e7caa529db09f32848314360cecfd91 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 5 Aug 2024 11:11:25 -0700 Subject: Added rm command to myriadfs tool. --- src/tools/myriadfs.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/tools') diff --git a/src/tools/myriadfs.cpp b/src/tools/myriadfs.cpp index c6dd416..587bc89 100644 --- a/src/tools/myriadfs.cpp +++ b/src/tools/myriadfs.cpp @@ -20,6 +20,7 @@ enum Mode modeCopyOut, modeMkdir, modeInitialize, + modeRm, modeNone }; @@ -67,6 +68,8 @@ public: eMode = modeMkdir; else if( aParams[0] == "initialize" ) eMode = modeInitialize; + else if( aParams[0] == "rm" ) + eMode = modeRm; else Bu::println("Unknown command, try --help"); return 0; @@ -247,6 +250,17 @@ int main( int argc, char *argv[] ) Bu::println("MyriadFs initialized.\n"); break; + case modeRm: + { + if( opt.lParams.getSize() != 1 ) + { + Bu::println("Specify a file path."); + return 1; + } + mFs.unlink( opt.lParams.first() ); + } + break; + case modeNone: break; } -- cgit v1.2.3