diff options
author | Laura <the-ceo-of-antifa@protonmail.com> | 2023-01-16 19:13:43 +0100 |
---|---|---|
committer | Laura <the-ceo-of-antifa@protonmail.com> | 2023-01-16 19:13:43 +0100 |
commit | dbf609a7e83e69abef13e5db57575ce101d5c9c5 (patch) | |
tree | 44735e37e5d352c3f58646823736f8afaff56115 | |
parent | 4657b2251d0a57e1059183807738d19b85ea9ea9 (diff) | |
download | miaowe-dbf609a7e83e69abef13e5db57575ce101d5c9c5.tar.gz miaowe-dbf609a7e83e69abef13e5db57575ce101d5c9c5.zip |
Code and Help commands
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | miaowe.hs | 8 |
2 files changed, 9 insertions, 1 deletions
@@ -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: @@ -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 |