Parse -u prior to -h
This commit is contained in:
parent
ea29526f54
commit
e5b2b4e016
1 changed files with 8 additions and 7 deletions
15
c4mate
15
c4mate
|
@ -305,6 +305,14 @@ function MatePad:give(amount, recipient, reason)
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- Parse -u flag (which may be given multiple times).
|
||||||
|
while arg[1] == "-u" do
|
||||||
|
table.remove(arg, 1)
|
||||||
|
USER = arg[1]
|
||||||
|
table.remove(arg, 1)
|
||||||
|
end
|
||||||
|
|
||||||
-- Process help and username options.
|
-- Process help and username options.
|
||||||
if arg[1] == "-h" or
|
if arg[1] == "-h" or
|
||||||
arg[1] == "--help" then
|
arg[1] == "--help" then
|
||||||
|
@ -326,13 +334,6 @@ Give credits:
|
||||||
os.exit(0)
|
os.exit(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Parse -u flag (which may be given multiple times).
|
|
||||||
while arg[1] == "-u" do
|
|
||||||
table.remove(arg, 1)
|
|
||||||
USER = arg[1]
|
|
||||||
table.remove(arg, 1)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Set up username.
|
-- Set up username.
|
||||||
if USER == nil then
|
if USER == nil then
|
||||||
USER = os.getenv("USER")
|
USER = os.getenv("USER")
|
||||||
|
|
Loading…
Reference in a new issue