]> git.lizzy.rs Git - idiot.git/commitdiff
Lösung Nr. 2: Verwenden Sie anstelle einer Liste 3/head
authorTheodorSmall <TheodorSmall@users.noreply.github.com>
Thu, 6 Jan 2022 18:28:12 +0000 (18:28 +0000)
committerTheodorSmall <TheodorSmall@users.noreply.github.com>
Thu, 6 Jan 2022 18:39:15 +0000 (18:39 +0000)
idiot
idiot-generator.lua

diff --git a/idiot b/idiot
index e4c59c97b856b6018c3fc792d4e962aa0732621e..bc11860612d77f8ae54c6430dab6da02404a1303 100755 (executable)
--- a/idiot
+++ b/idiot
@@ -1,5 +1,5 @@
 #! /bin/bash
-args=$2 $3 $4 $5 $6 $7 $8 $9
+args="${@:2:$#}"
 case $1 in
 "hinzufügen")
 git add $args
index e0eac7b416e038f4c41bd743d2e7f68433cd648d..3545c8ac3d54e62152a9fdbf1cdda2845efd171a 100755 (executable)
@@ -18,7 +18,7 @@ pf:close()
 
 local f = io.open("idiot", "w")
 f:write("#! /bin/bash\n")
-f:write("args=$2 $3 $4 $5 $6 $7 $8 $9\n")
+f:write("args=\"${@:2:$#}\"\n")
 
 f:write("case $1 in\n")