added a readme and a makefile

cleanup
m455 2020-06-15 14:09:05 -04:00
parent 6748e545c5
commit e52b3a1085
3 changed files with 93 additions and 20 deletions

58
Makefile 100644
View File

@ -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)/

View File

@ -1,35 +1,50 @@
# nicethings # nicethings
A Python program to be used on shared unix servers to cheer people up (A little program for [tilde.town](https://tilde.town)) A program for shared unix servers, specifically [tilde.town](https://tilde.town), to cheer people up .
# To-dos
- [ ] Decentralize by adding to and pulling from a text file in a user's home directory
# Table of Contents**
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc --> <!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc -->
# Table of Contents
- [How it works](#how-it-works) - [How it works](#how-it-works)
- [How it works in detail](#how-it-works-in-detail)
- [Installation](#installation)
- [Usage](#usage) - [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)
<!-- markdown-toc end --> <!-- markdown-toc end -->
# How it works # How it works
nicethings stores the user's input into a `list.txt` file if an argument is Users collaborate by adding or removing nice messages to their own
given in quotes. If no arguments are given, then a random line from the list, where the messages are combined and then displayed at random by
`list.txt` file will be displayed. 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 # Usage
Currently, a user can only add and output nice things to and from a list.txt located in m455's directory ```
town nicethings [<command>] [<args>]
## 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"` Examples:
town nicethings
## Outputting a random line from list.txt: town add \"You are beautiful\"
town ls
`$ nicethings` town rm 2
```