+int RunCommand(int argc, const char *argv[])
+{
+ if( argc < 1 ) return 0;
+
+ const char *name = argv[0];
+ if( strcmp("mount", name) == 0 )
+ {
+ // Mount an image
+ if( argc < 3 ) {
+ fprintf(stderr, "mount takes 2 arguments (image and mountpoint)\n");
+ return 0;
+ }
+
+ if( DiskTool_MountImage(argv[2], argv[1]) ) {
+ fprintf(stderr, "Unable to mount '%s' as '%s'\n", argv[1], argv[2]);
+ return -1;
+ }
+
+ return 2;
+ }
+ else if( strcmp("lvm", name) == 0 )
+ {
+ // Bind a "file" to LVM
+ if( argc < 3 ) {
+ fprintf(stderr, "lvm takes 2 arguments (iamge and ident)\n");
+ return 0;
+ }
+
+ if( DiskTool_RegisterLVM(argv[2], argv[1]) ) {
+ fprintf(stderr, "Unable to register '%s' as LVM '%s'\n", argv[1], argv[2]);
+ return -1;