summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaura <the-ceo-of-antifa@protonmail.com>2023-01-16 19:13:43 +0100
committerLaura <the-ceo-of-antifa@protonmail.com>2023-01-16 19:13:43 +0100
commitdbf609a7e83e69abef13e5db57575ce101d5c9c5 (patch)
tree44735e37e5d352c3f58646823736f8afaff56115
parent4657b2251d0a57e1059183807738d19b85ea9ea9 (diff)
downloadmiaowe-dbf609a7e83e69abef13e5db57575ce101d5c9c5.tar.gz
miaowe-dbf609a7e83e69abef13e5db57575ce101d5c9c5.zip
Code and Help commands
-rw-r--r--README.md2
-rw-r--r--miaowe.hs8
2 files changed, 9 insertions, 1 deletions
diff --git a/README.md b/README.md
index 24508a3..09b6ff5 100644
--- a/README.md
+++ b/README.md
@@ -14,6 +14,8 @@ Miaowe includes no networking code of its own, but assumes stdin and stdout will
Available commands:
* List -- lists all files in PWD
+* Code -- shows code URL
+* Help -- helps
* Quit -- quits
To run:
diff --git a/miaowe.hs b/miaowe.hs
index 6ee36c2..f7fb8e6 100644
--- a/miaowe.hs
+++ b/miaowe.hs
@@ -41,6 +41,9 @@ data Image = Image {
imgHeight :: Int
}
+codeUrl = "https://gitlab.com/laleanor/miaowe"
+helpString = "Commands available: List; Code; Help. Anything else is interpreted as a file name."
+
ctrlC = [toEnum 03] :: String
ctrlO = [toEnum 15] :: String
ctrlV = [toEnum 22] :: String
@@ -185,7 +188,10 @@ processCommand channel command | length (words command) < 5 = sendToChannel chan
"You need to specify a command."
| (words command)!!4 == "Quit" = exitSuccess
| (words command)!!4 == "List" = listDirectory "."
- >>= sendToChannel channel . intercalate "\n"
+ >>= sendToChannel channel .
+ intercalate "\n"
+ | (words command)!!4 == "Code" = sendToChannel channel codeUrl
+ | (words command)!!4 == "Help" = sendToChannel channel helpString
| otherwise = (if isInfixOf "/" ((words command)!!4)
then
sendToChannel channel