aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorGravatar BanceDev 2024-09-10 14:32:59 -0400
committerGravatar BanceDev 2024-09-10 14:32:59 -0400
commit23fb50c50922d7d4d9d0b1ea851e77f342b45de8 (patch)
treed8d1770a8f565b73bd429831a8945cdf717ca1b2 /README.md
parentadded handling for when prompt gets longer than terminal width (diff)
added better demo to readme
Diffstat (limited to 'README.md')
-rw-r--r--README.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/README.md b/README.md
index df29381..a1ef970 100644
--- a/README.md
+++ b/README.md
@@ -30,6 +30,16 @@ To update Lunar Shell pull the repo and run the install script again.
<img width="512" height=auto src="https://github.com/BanceDev/lush/blob/main/demo.png">
</p>
+```lua
+if args ~= nil and args[1] ~= nil then
+ if args[1]:match("%.c$") then
+ lush.exec("gcc -o " .. args[1]:sub(1, -3) .. " " .. args[1])
+ end
+else
+ print("must pass a C file to compile")
+end
+```
+
With the robust and ever growing Lua API that Lunar Shell has builtin, not only can you create powerful shell scripts to automate your workflow but also reap the benefits of having an easy to understand scripting language embedded into your command line.
To run a Lua script with Lunar Shell just type the name of the lua file you want to run followed by any arguments you want to pass to the script. Lunar Shell will automatically search the current working directory as well as the ```~/.lush/scripts``` directory and then execute the file if it locates a match.