summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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