From e52b3a1085b56ab9d6ce6d49ee98aa32ef978b6d Mon Sep 17 00:00:00 2001 From: m455 Date: Mon, 15 Jun 2020 14:09:05 -0400 Subject: [PATCH] added a readme and a makefile --- Makefile | 58 ++++++++++++++++++++++++++++ README.md | 55 ++++++++++++++++---------- nicethings.rkt => src/nicethings.rkt | 0 3 files changed, 93 insertions(+), 20 deletions(-) create mode 100644 Makefile rename nicethings.rkt => src/nicethings.rkt (100%) diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2f289af --- /dev/null +++ b/Makefile @@ -0,0 +1,58 @@ +directory-local = ~/.local/bin +directory-global = /usr/local/bin +directory-source = src +directory-current = . + +file-source = nicethings.rkt +file-source-source = $(directory-source)/$(file-source) + +file-executable = nicethings +file-executable-local = $(directory-local)/$(file-executable) +file-executable-global = $(directory-global)/$(file-executable) +file-executable-source= $(directory-source)/$(file-executable) +file-executable-current= $(directory-current)/$(file-executable) + +help: + @echo "How to use this Makefile" + @echo " make [command]" + @echo "" + @echo "This Makefile supports the following commands:" + @echo " help - Displays this help message" + @echo " clean - Removes any $(file-executable) executable from $(directory-source)/" + @echo " build - Creates a $(file-executable) executable in your current directory" + @echo " install-global - Installs a $(file-executable) executable in $(directory-global)/" + @echo " uninstall-global - Deletes a $(file-executable) executable from $(directory-global)/" + @echo " install-local - Installs a $(file-executable) executable in $(directory-local)/" + @echo " uninstall-local - Deletes a $(file-executable) executable from $(directory-local)/" + +install: + @echo "Try running make help" + +uninstall: + @echo "Try running make help" + +uninstall-local: + @echo "Uninstalling $(file-executable) from $(file-executable-local) ..." + @rm -f $(file-executable-local) + +uninstall-global: + @echo "Uninstalling $(file-executable) from $(file-executable-global) ..." + @rm -f $(file-executable-global) + +install-local: build + @echo "Moving $(file-executable-current) to $(file-executable-local) ..." + @mv $(file-executable-current) $(file-executable-local) + +install-global: build + @echo "Moving $(file-executable-current) to $(file-executable-global) ..." + @mv $(file-executable-current) $(file-executable-global) + +clean: + @echo "Deleting any $(file-executable) executables found in your current folder ..." + @rm -f $(file-executable-current) + +build: + @echo "Creating $(file-executable-source) executable from $(file-source-source) ..." + @raco exe $(file-source-source) + @echo "Moving $(file-executable-source) executable to your current folder ..." + @mv $(file-executable-source) $(directory-current)/ diff --git a/README.md b/README.md index dc44602..d820bc8 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,50 @@ # nicethings -A Python program to be used on shared unix servers to cheer people up (A little program for [tilde.town](https://tilde.town)) - -# To-dos - -- [ ] Decentralize by adding to and pulling from a text file in a user's home directory +A program for shared unix servers, specifically [tilde.town](https://tilde.town), to cheer people up . +# Table of Contents** -# Table of Contents - - [How it works](#how-it-works) + - [How it works in detail](#how-it-works-in-detail) +- [Installation](#installation) - [Usage](#usage) - - [Adding a message to the file:](#adding-a-message-to-the-file) - - [Outputting a random line from list.txt:](#outputting-a-random-line-from-listtxt) - # How it works -nicethings stores the user's input into a `list.txt` file if an argument is -given in quotes. If no arguments are given, then a random line from the -`list.txt` file will be displayed. +Users collaborate by adding or removing nice messages to their own +list, where the messages are combined and then displayed at random by +any user. + +## How it works in detail + +* Each user has a `~/.nicethings` directory. +* Users can add messages to this file using the `nicethings add "your nice message here"` interface. +* Each message is stored in the file as separate lines. No file format is used. +* Users can display a numbered list of the messages they have stored using the `nicethings ls` interface. +* Users can remove their own messages using the `nicethings rm 2` interface, where the number refers to an item in their list. +* Users can view a random message from a random user using the `nicethings` interface (with no arguments). + +# Installation + +1. Run `git clone https://github.com/m455/nicethings` +2. Run `cd nicethings` +3. Run `make` for further instructions. # Usage -Currently, a user can only add and output nice things to and from a list.txt located in m455's directory +``` +town nicethings [] [] -## Adding a message to the file: +Commands: + No command - Print a random nice thing. + add - Add a message to the list of nice things. + ls - Print a numbered list of the nice things you have added. + rm - Remove a message you have added from the list of nice things. -`$ nicethings "insert your message here"` - -## Outputting a random line from list.txt: - -`$ nicethings` +Examples: + town nicethings + town add \"You are beautiful\" + town ls + town rm 2 +``` diff --git a/nicethings.rkt b/src/nicethings.rkt similarity index 100% rename from nicethings.rkt rename to src/nicethings.rkt