summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Fankhauser hiddenalpha.ch2022-12-13 20:40:30 +0100
committerAndreas Fankhauser hiddenalpha.ch2022-12-13 20:40:30 +0100
commita68888d55f3525c078c74e8b2f75ea8e3e4a4b7f (patch)
tree21369443564fc74b16e4e57673fe511679327d00
parent8970f3753a08f851b8dfbe751eb4694f8084c4d0 (diff)
downloaddotfiles-a68888d55f3525c078c74e8b2f75ea8e3e4a4b7f.zip
dotfiles-a68888d55f3525c078c74e8b2f75ea8e3e4a4b7f.tar.gz
Small Cleanup
-rw-r--r--src/bash/_bashrc6
-rw-r--r--src/file-templates/scriptlee.lua20
2 files changed, 14 insertions, 12 deletions
diff --git a/src/bash/_bashrc b/src/bash/_bashrc
index df0c285..af3ee3e 100644
--- a/src/bash/_bashrc
+++ b/src/bash/_bashrc
@@ -1,7 +1,7 @@
-WINDOOF=$(if test -d /c/Windows; then echo true; else echo false; fi)
+WINDOOF=$(if [ -d /c/Windows ]; then echo true; else echo false; fi)
-if test -d ~/.bin ; then
+if [ -d ~/.bin ]; then
PATH=~/.bin:$PATH
fi
@@ -33,7 +33,7 @@ if $WINDOOF; then
# Fix vim-behind-ssh on windoof
# TODO this fixes the remote shell, but breaks the local one (Eg del prints
# tilde). Grr ....
- #if test -n "$ConEmuBuild"; then TERM=dumb; export TERM; fi
+ #if [ -n "$ConEmuBuild" ]; then TERM=dumb; export TERM; fi
fi
diff --git a/src/file-templates/scriptlee.lua b/src/file-templates/scriptlee.lua
index ac46bbb..75da940 100644
--- a/src/file-templates/scriptlee.lua
+++ b/src/file-templates/scriptlee.lua
@@ -19,18 +19,20 @@ function mod.printHelp()
end
-function mod.parseArgs( this )
+function mod.parseArgs( app )
local positionalArgNr = 0
- for iA=1, #_ENV.arg do
+ local iA = 0
+ while true do iA = iA +1
local arg = _ENV.arg[iA]
- if false then
+ if not arg then
+ break
elseif arg == "--help" then
mod.printHelp() return -1
elseif not arg:find("^%-%-") then
positionalArgNr = positionalArgNr + 1
if false then
--elseif positionalArgNr == 1 then
- -- this.whatever = arg
+ -- app.whatever = arg
else
log:write("Unexpected arg: ".. arg .."\n")return -1
end
@@ -38,22 +40,22 @@ function mod.parseArgs( this )
log:write("Unexpected arg: ".. arg .."\n")return -1
end
end
- if not this.whatever then log:write("TODO write errmsg here\n")return -1 end
+ if not app.whatever then log:write("TODO write errmsg here\n")return -1 end
return 0
end
-function mod.run( this )
+function mod.run( app )
log:write("[INFO ] TODO impl what the prog should do\n")
end
function mod.main()
- local this = objectSeal{
+ local app = objectSeal{
whatever = false,
}
- if mod.parseArgs(this) ~= 0 then os.exit(1) end
- mod.run(this)
+ if mod.parseArgs(app) ~= 0 then os.exit(1) end
+ mod.run(app)
end