Adds another commandline option `-n` to the application which prevents
newlines from being added at the end of each output.
Disabled by default.
Co-authored-by: Marty Oehme <marty.oehme@gmail.com>
Can combine command options (-c, -t, -e) in any way to simultaneously
clip, type and/or echo the picked results.
Still defaults to clipping, as before.
If a custom default command is given with `BEMOJI_DEFAULT_CMD` env var,
then invoking bemoji without any command option will invoke this
command. Otherwise, the other commands are added to the default given
command.
Additionally, refactor echo command to mirror other commands
Both typing and clipping simply invoke the corresponding program
function while echo had an extra role so far. This adjusts the echo
command to also work the same way.
Added a simple test for each of the base command options: echo, type,
clip. It uses custom commands set through environment options so does
not yet test the actual default command logic (finding a typer,
clipper), that is still a TODO.
Also split tests into tests concerning commands of the program and tests
concerning the directory settings and options of the program, to avoid
ending up with a single test file spanning hundreds of lines.
Added simple tests for database and cache locations.
Moved test PATH setup to new file-level function which should slightly
speed up testing and makes more sense conceptually to set the bemoji
executable to be in the path once for all tests.
Added a quick way to see if directories have been set up correctly. This
also eases testing for future ways of setting directories through
environment variables or options.
Now that the project is finding a little adoption it is really high time
to bring some tests into the code to ensure everything works as it
should.
This first version will only provide a simple test harness from which
tests can slowly be written for other parts of the program.