This is a simple command line tool to enable creating and keeping track of tasks that need to be done.
The major reason for this project is to have a simple project that allows some degree of experimentation. While the logic of an app is not particularly perplexing, it allows to gain, improve and solidify knowledge about:
- Java (8/9)
- SQL
- HSQLDB
- JDBC
- Liquibase
- Log4j2
- Maven
- Commons CLI
- Design patters
If something useful comes out of it, all the better for it.
- Clone the repo
- Ensure you have Maven installed
- Run the following commands:
mvn clean install mvn exec:java -Dexec.args="arguments"
Alternatively, it is possible to set up the program so that it can be called
by simply entering tasks (or any other preferred word).
To do so:
- Clone the repo
- Ensure you have Maven installed
- Run the following command:
This will package the program into one massive jar (~10mb), which can be launched like this:
mvn clean packagejava -jar target/tasks-1.0-SNAPSHOT-jar-with-dependencies.jar {arguments} - Copy this jar to a location that you feel is appropriate for it. For example,
/opt/,/usr/local/, or simply~/ - Create a shell script with a name
tasks(or any other preferred name). How the script should/might look can be seen intasksfile. - Give execution permissions to the file you created:
chmod u+x filename - Move the file to
/usr/local/bin:sudo mv filename /usr/local/bin - Reload the terminal:
source ~/.bashrc - Try it out:
If all goes well, you should see the following output:
tasks -a Example task -d today -cat testTASKS :: Successfully saved a task with id=1
Currently supported commands are:
Adding tasks:
{no arguments} Shows all tasks.
-help -h Prints help message.
-add -a <task> Adds a task.
-d <n> Sets a deadline for a task (n days).
For convenience, "today" and "tomorrow"
are also supported.
-filter -f <filter> Filters saved tasks. Tasks can be filtered
on deadline. Filter can be any of the
following:
* none - unset deadline
* integer - days from today
* today - same as 0
* tomorrow - same as 1
If none of these are supplied, filtering
is done on the categories instead.
-remove -rm <id> Deletes a task with a specified id.
-clear Deletes all tasks.