aboutsummaryrefslogtreecommitdiffstats
path: root/lua/utils
diff options
context:
space:
mode:
authorSquibid <me@zacharyscheiman.com>2023-07-18 09:25:40 +0000
committerSquibid <me@zacharyscheiman.com>2023-07-18 09:25:40 +0000
commit20ef83bcaaf46b45571879915e6df957a15e2504 (patch)
tree19e4ea2642d23f2a5f485832555de251f605a12e /lua/utils
downloadgit-yodel-20ef83bcaaf46b45571879915e6df957a15e2504.tar.gz
git-yodel-20ef83bcaaf46b45571879915e6df957a15e2504.tar.bz2
git-yodel-20ef83bcaaf46b45571879915e6df957a15e2504.zip
aaa
Diffstat (limited to '')
-rw-r--r--lua/utils/simple.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/lua/utils/simple.lua b/lua/utils/simple.lua
new file mode 100644
index 0000000..637dcde
--- /dev/null
+++ b/lua/utils/simple.lua
@@ -0,0 +1,22 @@
+local M = {}
+
+function M.lower(a, b)
+ if a > b then return b else return a end
+end
+
+function M.tablelength(T)
+ local c = 0
+ for _ in pairs(T) do c = c + 1 end
+ return c
+end
+
+function M.cmdcontent(cmd)
+ local b = {}
+ local a = io.popen(cmd, 'r')
+ if a == nil then return end
+ for _ in a:lines() do table.insert(b, _) end
+ a:close()
+ return b
+end
+
+return M