From 224fba34bbd39916731ee65ee740d5af51a2ec6e Mon Sep 17 00:00:00 2001 From: Shy Date: Thu, 22 Aug 2024 22:31:31 +0200 Subject: [PATCH] Allow multiple -u flags --- c4mate | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/c4mate b/c4mate index 7a84755..7c746f7 100755 --- a/c4mate +++ b/c4mate @@ -136,8 +136,7 @@ sed -n ' T fail b :fail - q 1 -']=], self.CURL_FLAGS, self.HOST, url_encode(self.USER), datefile)) + q 1 ']=], self.CURL_FLAGS, self.HOST, url_encode(self.USER), datefile)) while true do local entry = {} @@ -242,8 +241,7 @@ sed -n --sandbox ' T fail b :fail - q 1 -']=], self.CURL_FLAGS, self.HOST)) + q 1 ']=], self.CURL_FLAGS, self.HOST)) while true do local item = {} @@ -311,10 +309,11 @@ Add or subtract credits: c4mate Give credits: c4mate -g []]=]) - return + os.exit(0) +end --- Parse -u flag. -elseif arg[1] == "-u" then +-- 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)