Instead of `-P` being a flag for showing history it has become an option
whose argument is the number of history entries to show, `-P 4`.
To mimic the old behavior use `-P 0`.
Added some test coverage for history functionality.
Fixes #1.
Usage instructions for mapping the picker in riverwm falsely assumed the
super key to already be mapped to a `$mod` variable. This commit fixes
it to replace mention of the variable with the key name itself.
Generalized AUR package installation instructions slightly to take note
of the fact that there are multiple AUR packages available for bemoji.
Thanks to @thayne for packaging up the semver release version of bemoji
for the AUR!
Previously, stdin contents were consumed and then not passed through to
the typing tool. With this commit, they are correctly passed to any
custom tool's stdin.
Fixes #19.
When making no selection, i.e. cancelling during the selection process
the program will return status code 1, whereas before it would carry the
same return code as when making an emoji selection.
Fixes #20.
Switched the history from using the XDG_CACHE_HOME directory by default
to use XDG_STATE_HOME by default.
This makes sense since cache can (and should be prepared to) be wiped at
any moment and the program functionality should not be hindered by this.
Since we need to retain history through such wipes the newly introduced
state directory is the perfect match for keeping the history file in.
This does constitute a breaking change for existing histories which need
to be moved to the new directory if they made use of the old cache
directory.
Concurrent with this we are renaming `XDG_CACHE_LOCATION` environment
variable to `XDG_HISTORY_LOCATION` so this is a second breaking change
for those using a custom location for their histories.
This change attempts to make the naming scheme coherent and remove some
left-over naming cruft from the old location being the cache directory.
This provides one of the larger changes to the program so far.
Fixes #5.
Changed `-D` option to always download the lists supplied, regardless of
the database directory being empty or not.
This means you can download additional lists after the first program
run, or re-download lists later on. It *will* overwrite your custom
changes however if your files are called the same as the default list
names.
Additionally removed dependency on GNU version of cut and added some
simple tests for the download functionality.
Fixes #16.
Using woodpecker ci most of the release process is now automated.
That means as soon as a new version tag (e.g. `v0.2.3`) is pushed the
release process is started and will (if versions have been bumped
correctly) set up a new release on Gitea and Github simultaneously.
The release process will fail if changelog and program versions
mismatch, or the version has not been bumped in general.
The release contains the executable and some documentation, including
the README as a manpage-formatted gzip file which can be included in the
correct directory to enable a simple manpage for the program.
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>
Removed redundant 'redirection' functions which did nothing to change
code and only extended the pipe with an additional `cat` call.
Renamed bm_default_cmd to bm_cmds to reflect its nature as an array.
Since there is not just one command contained in the variable anymore,
it makes much more sense to now call it bm_cmds, note the plural.
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.
Switched sections for dependencies and installation around and created
better sub-headings.
Added section on installing packaged AUR version, thanks to @firegem for
packaging it!
Fixed some whitespace on line endings.
Closes #6.