aboutsummaryrefslogtreecommitdiff
path: root/src/tools/myriadfs.cpp
diff options
context:
space:
mode:
authorMike Buland <mike@xagasoft.com>2024-08-05 11:11:25 -0700
committerMike Buland <mike@xagasoft.com>2024-08-05 11:11:25 -0700
commit5f183d4a0e7caa529db09f32848314360cecfd91 (patch)
tree09a1e623ca67989233965ba419601f2b39985c72 /src/tools/myriadfs.cpp
parente343acc2548fba7670977029da8373a0e58fa25a (diff)
downloadlibbu++-5f183d4a0e7caa529db09f32848314360cecfd91.tar.gz
libbu++-5f183d4a0e7caa529db09f32848314360cecfd91.tar.bz2
libbu++-5f183d4a0e7caa529db09f32848314360cecfd91.tar.xz
libbu++-5f183d4a0e7caa529db09f32848314360cecfd91.zip
Added rm command to myriadfs tool.
Diffstat (limited to '')
-rw-r--r--src/tools/myriadfs.cpp14
1 files changed, 14 insertions, 0 deletions
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
20 modeCopyOut, 20 modeCopyOut,
21 modeMkdir, 21 modeMkdir,
22 modeInitialize, 22 modeInitialize,
23 modeRm,
23 24
24 modeNone 25 modeNone
25}; 26};
@@ -67,6 +68,8 @@ public:
67 eMode = modeMkdir; 68 eMode = modeMkdir;
68 else if( aParams[0] == "initialize" ) 69 else if( aParams[0] == "initialize" )
69 eMode = modeInitialize; 70 eMode = modeInitialize;
71 else if( aParams[0] == "rm" )
72 eMode = modeRm;
70 else 73 else
71 Bu::println("Unknown command, try --help"); 74 Bu::println("Unknown command, try --help");
72 return 0; 75 return 0;
@@ -247,6 +250,17 @@ int main( int argc, char *argv[] )
247 Bu::println("MyriadFs initialized.\n"); 250 Bu::println("MyriadFs initialized.\n");
248 break; 251 break;
249 252
253 case modeRm:
254 {
255 if( opt.lParams.getSize() != 1 )
256 {
257 Bu::println("Specify a file path.");
258 return 1;
259 }
260 mFs.unlink( opt.lParams.first() );
261 }
262 break;
263
250 case modeNone: 264 case modeNone:
251 break; 265 break;
252 } 266 }