diff options
author | Andreas Fankhauser hiddenalpha.ch | 2022-11-30 16:22:55 +0100 |
---|---|---|
committer | Andreas Fankhauser hiddenalpha.ch | 2022-11-30 16:22:55 +0100 |
commit | bcfc485378f3f240fc3c12aed149d16487f42d56 (patch) | |
tree | a78f676afd45196d69fd468797ce02d410398ac2 | |
parent | 4e0776e378f096931ff3298e16b6dcec708d50dd (diff) | |
download | UnspecifiedGarbage-bcfc485378f3f240fc3c12aed149d16487f42d56.zip UnspecifiedGarbage-bcfc485378f3f240fc3c12aed149d16487f42d56.tar.gz |
Add some link. Impl help cmd for TarScan.lua
-rw-r--r-- | doc/note/links/links.txt | 4 | ||||
-rw-r--r-- | src/main/lua/misc/TarScan.lua | 34 |
2 files changed, 37 insertions, 1 deletions
diff --git a/doc/note/links/links.txt b/doc/note/links/links.txt index e0aef8c..2005d56 100644 --- a/doc/note/links/links.txt +++ b/doc/note/links/links.txt @@ -16,6 +16,9 @@ Links (Aka arguments) - "https://spring.io/blog/2007/07/11/setter-injection-versus-constructor-injection-and-the-use-of-required/" - "http://evan.bottch.com/2009/02/03/setter-injection-sucks/" +## Dependency Injection violation +- [Houston, ich glaub mir wird schlecht](https://gitit.post.ch/projects/ISA/repos/houston/pull-requests/410/overview?commentId=231234) + ## Pro DI over inheritance: - "https://stackoverflow.com/questions/30767395/when-to-use-di-over-abstract-inheritance" @@ -213,6 +216,7 @@ Links (Aka arguments) - "https://jira.post.ch/browse/SDCISA-8136" - "https://jira.post.ch/browse/SDCISA-2876" - "https://jira.post.ch/browse/SDCISA-9059" +- [vortex too slow](https://jira.post.ch/browse/SDCISA-9990) ## Performance clang micro benchmarking - "https://m.youtube.com/watch?v=nXaxk27zwlk" diff --git a/src/main/lua/misc/TarScan.lua b/src/main/lua/misc/TarScan.lua index 99199ab..45f9752 100644 --- a/src/main/lua/misc/TarScan.lua +++ b/src/main/lua/misc/TarScan.lua @@ -16,6 +16,38 @@ local mod = {} local stdinn, stdout, stdlog = io.stdin, io.stdout, io.stderr +function mod.printHelp() + stdout:write("\n" + .." ThrowAway script to extract needed data from tar and throw it into\n" + .." a CSV.\n" + .."\n" + .." Options:\n" + .."\n" + .." --risky\n" + .." WARN: only use this if you know what you're doing.\n" + .."\n") +end + + +function mod.parseArgs( app ) + local iA = 0 + local isRisky = false + while true do iA = iA + 1 + local arg = _ENV.arg[iA] + if not arg then break end + if arg == "--help" then + mod.printHelp() return -1 + elseif arg == "--risky" then + isRisky = true + else + stdlog:write("Unexpected arg: "..arg.."\n") return-1 + end + end + if not isRisky then stdlog:write("Bad Args\n")return-1 end + return 0 +end + + function mod.onTarHeader( hdr, app ) local filename = hdr.filename app.currentFileName = hdr.filename @@ -70,7 +102,7 @@ function mod.main() fileIsRelevant = false, eddieName = false, } - --TODO if mod.parseArgs() ~= 0 then os.exit(1) end + if mod.parseArgs() ~= 0 then os.exit(1) end mod.run(app) end |