diff options
Diffstat (limited to 'fstools/fstools.cpp')
-rw-r--r-- | fstools/fstools.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/fstools/fstools.cpp b/fstools/fstools.cpp new file mode 100644 index 0000000..b1cc7ad --- /dev/null +++ b/fstools/fstools.cpp @@ -0,0 +1,23 @@ +#include <stdlib.h> + +extern "C" { +#include "fstools.h" +} + + +int +main(int argc, char **argv) { + + // Handle alternative invocations + char* command = argv[0]; + char* stripped = strrchr(argv[0], '/'); + if (stripped) + command = stripped + 1; + + if (strcmp(command, "fstools") != 0) { + struct fstools_cmd cmd = get_command(command); + if (cmd.name) + return cmd.main_func(argc, argv); + } + return -1; +} |