diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-06-13 21:24:22 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-06-13 21:24:22 -0400 |
| commit | ce66358d06313e8d3643a60a41ff2b629929b9ae (patch) | |
| tree | d0eb688daaf82d4aa872b0a4deb48cc4d0e149da /tomo.c | |
| parent | 81d55cacb7b86add20613510b8fa9da74e58bdca (diff) | |
Add `tomo -u foo` to uninstall foo
Diffstat (limited to 'tomo.c')
| -rw-r--r-- | tomo.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -58,6 +58,13 @@ int main(int argc, char *argv[]) } else if (streq(argv[i], "-h") || streq(argv[i], "--help")) { printf("Usage: %s | %s [-r] file.tm args... | %s (-t|-c|-s) file1.tm file2.tm...\n", argv[0], argv[0], argv[0]); return 0; + } else if (streq(argv[i], "-u")) { + // Uninstall libraries: + for (int j = i + 1; j < argc; j++) { + system(heap_strf("rm -rvf ~/.local/src/tomo/%s ~/.local/include/tomo/lib%s.h ~/.local/lib/tomo/lib%s.so", + argv[j], argv[j], argv[j])); + } + return 0; } else if (strchr(argv[i], '=')) { while (argv[i][0] == '-') ++argv[i]; |
