diff options
| author | EuAndreh <eu@euandre.org> | 2026-06-12 09:19:28 -0300 |
|---|---|---|
| committer | EuAndreh <eu@euandre.org> | 2026-06-12 09:19:28 -0300 |
| commit | 46fd0362bce11d709e5efe6d540358533985d363 (patch) | |
| tree | f77d2ed33c4f3fb6e85353e436efca4e19028f73 | |
| parent | rm .tdrc COPYING (diff) | |
| download | remembering-46fd0362bce11d709e5efe6d540358533985d363.tar.gz remembering-46fd0362bce11d709e5efe6d540358533985d363.tar.xz | |
Rewrite remembering in Go
The shell pipeline (sed | sort | tee | awk | sort | cut | "$@"
plus the cut | uniq | awk profile rewrite) becomes a single static
binary with the same observable behaviour, pinned by the original
ranking.sh, signals.sh and cli-opts.sh suites, now aimed at
remembering.bin:
- the profile keeps the exact on-disk format, COUNT profile TEXT,
byte-sorted with new picks appended at 1 and offered-but-never-
picked entries persisted at 0;
- the menu stays count-descending with byte-order ties, stdin
alone defines what is offered, and duplicate profile lines sum
for ranking but collapse to the highest count on rewrite, as
sort | uniq -f1 did;
- the wrapped command's exit status is forwarded as-is (128+sig
for signal deaths), its stderr passes through, and an empty pick
learns nothing;
- the profile rewrite stays atomic via .tmp plus rename.
Per the house CLI conventions, -h/-V/--help/--version are gone
(the manpage is the documentation; bad options print the usage on
stderr and exit 2), and getopts-style attached option arguments
(-pNAME) are not accepted any more --- no script in the wild used
them.
The project layout follows rot: raw go tool compile/link Makefile,
mkdeps.sh-generated deps.mk, white-box unit suite, fuzz target
over the profile parse/serialize roundtrip, functional pick
roundtrip, a 1M-line ranking benchmark, and a single English
asciidoc manpage absorbing the old .5 page; the po4a/aux release
machinery goes away.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
83 files changed, 1669 insertions, 9089 deletions
@@ -1,10 +1,16 @@ -/*.??.md -/*.html -/doc/*.html -/public/ +/doc/*.1 +/src/meta.go +/*.bin +/src/*.a +/src/*.bin +/tests/*.a +/tests/*.bin +/tests/functional/*/*.a +/tests/functional/*/*.bin +/tests/fuzz/*/*.a +/tests/fuzz/*/*.bin +/tests/benchmarks/*/*.a +/tests/benchmarks/*/*.bin +/tests/benchmarks/*/*.txt +/tests/fuzz/corpus/ /tests/test-profiles/ -/src/remembering -*.mo -*.po~ -/doc/*.[0-9] -/*.sentinel diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index aa7bb29..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,125 +0,0 @@ -<!-- Entry template: --> -<!-- -# Unreleased -## Added -## Changed -## Deprecated -## Removed -## Fixed -## Security ---> - -Changelog for [remembering](https://euandre.org/remembering/en/). - - -# Unreleased - - -# [0.3.0](https://euandre.org/git/remembering/commit/?id=v0.3.0) - 2022-11-25 - -## Added - -### Inference of profiles - -## Changed - -### Remove `-c COMMAND` option - -Instead of requiring a `-c COMMAND` option explicitly, instead receive the -commands to be ran as the "rest" argument to `remembering`, stored in `$@`. The -usage changes from: - -```shell -$ remembering -p a-profile -c 'command $arg1 arg2' -``` - -to: - -```shell -$ remembering -p a-profile -- command $arg1 arg2 -``` - -The upsides are: -1. no need to worry about nested quotes: requiring a `-c COMMAND` option forced - one to wrap the command and args inside quotes, and the quotation used - influenced the command to be ran; -1. one less option to know about: instead of having to remember what is the - specific letter used for the command, just prefix the command with - `remembering`; -1. simpler and more powerful composition: wrapping commands without quoting them - allows one to use many of such tools in combination: - -```shell -$ time nice -n10 timeout 3 remembering sleep 5 -``` - - The equivalent with `-c COMMAND` would be: - -```shell -$ time -c 'nice -n10 -c "timeout 3 -c 'remembering -c "sleep 5"'"' -``` - - But instead of alternating between single and double quotes, properly quoting - them at each level. - -## Fixed - -### Improve speed - -Rewrite to make it faster - - -## Changed - -### Use of `$XDG_DATA_HOME` - -When the environment variable `$XDG_DATA_HOME` is defined, remembering now -appends a trailing `/remembering` to it instead of start writing files to where -the environment variable points to. - -This is in conformance with the [XDG Base Directory Specification][xdg]. - -[xdg]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html - -### Exit code - -When remembering encounters an unrecognized option, it now exits with 2 instead of ignoring it. - - -# [0.2.1](https://euandre.org/git/remembering/commit/?id=v0.2.1) - 2021-02-23 - -## Removed - -Revert to plain `Makefile` over `./configure` + `Makefile.in`. - - -# [0.2.0](https://euandre.org/git/remembering/commit/?id=v0.2.0) - 2021-02-21 - -## Added - -Add trivial `./configure` script. - -## Changed - -Assume standard input is already sorted for faster processing. - - -# [0.1.2](https://euandre.org/git/remembering/commit/?id=v0.1.2) - 2021-01-26 - -## Fixed - -Replace usage of GNU Coreutils' specific `tac` utility with `sed`. - - -# [0.1.1](https://euandre.org/git/remembering/commit/?id=v0.1.1) - 2021-01-26 - -## Fixed - -Allow names with spaces. - - -# [0.1.0](https://euandre.org/git/remembering/commit/?id=v0.1.0) - 2021-01-26 - -## Added - -Initial public release. @@ -1,88 +1,191 @@ .POSIX: +DATE = 1970-01-01 +VERSION = 0.1.0 +NAME = remembering +NAME_UC = $(NAME) +## Installation prefix. Defaults to "/usr". PREFIX = /usr +BINDIR = $(PREFIX)/bin +LIBDIR = $(PREFIX)/lib +GOLIBDIR = $(LIBDIR)/go +SRCDIR = $(PREFIX)/src/$(NAME) SHAREDIR = $(PREFIX)/share +LOCALEDIR = $(SHAREDIR)/locale MANDIR = $(SHAREDIR)/man -VERSION = 0.3.0 -DATE = 2022-11-25 -NAME = remembering -MAILING_LIST = public-inbox +EXEC = ./ +## Where to store the installation. Empty by default. +DESTDIR = +LDLIBS = --static +GOCFLAGS = -I $(GOLIBDIR) +GOLDFLAGS = -L $(GOLIBDIR) +N = `nproc` + .SUFFIXES: -.SUFFIXES: .in +.SUFFIXES: .go .a .bin .bin-check .adoc -.in: - sed \ - -e 's:@VERSION@:$(VERSION):g' \ - -e 's:@DATE@:$(DATE):g' \ - -e 's:@NAME@:$(NAME):g' \ - < $< > $@ - if [ -x $< ]; then chmod +x $@; fi +.go.a: + go tool compile -I $(@D) $(GOCFLAGS) -o $@ -p $(*F) \ + `find $< $$(if [ $(*F) != main ]; then \ + echo src/$(NAME).go src/meta.go; fi) | uniq` +.a.bin: + go tool link -L $(@D) $(GOLDFLAGS) -extld $(CC) \ + -o $@ --extldflags '$(LDLIBS)' $< -manpages.en.in = \ - doc/remembering.en.1.in \ - doc/remembering.en.5.in -manpages.in = $(manpages.en.in) \ - doc/remembering.pt.1.in \ - doc/remembering.fr.1.in \ - doc/remembering.eo.1.in \ - doc/remembering.pt.5.in \ - doc/remembering.fr.5.in \ - doc/remembering.eo.5.in -manpages = $(manpages.in:.in=) +.adoc: + asciidoctor -b manpage -o $@ $< -all: src/remembering $(manpages) +all: +include deps.mk -src/remembering: src/remembering.in +libs.a = $(libs.go:.go=.a) +mains.a = $(mains.go:.go=.a) +mains.bin = $(mains.go:.go=.bin) +functional/lib.a = $(functional/lib.go:.go=.a) +fuzz/lib.a = $(fuzz/lib.go:.go=.a) +benchmarks/lib.a = $(benchmarks/lib.go:.go=.a) +manpages = $(manpages.adoc:.adoc=) -test-files = \ - tests/cli-opts.sh \ - tests/ranking.sh \ - tests/signals.sh \ +sources = \ + src/$(NAME).go \ + src/meta.go \ + src/main.go \ -$(test-files): src/remembering ALWAYS - @echo sh $@ -check: $(test-files) +derived-assets = \ + src/meta.go \ + $(libs.a) \ + $(mains.a) \ + $(mains.bin) \ + $(NAME).bin \ + $(manpages) \ -clean: - rm -rf \ - public/ $(manpages) *.*.md *.sentinel doc/*.html *.html \ - src/remembering tests/test-profiles/ aux/preamble-md \ - aux/generated.mk aux/checks/manpages/*.0 +side-assets = \ + tests/fuzz/corpus/ \ + tests/benchmarks/*/main.txt \ + tests/test-profiles/ \ -install: all - mkdir -p '$(DESTDIR)$(PREFIX)/bin' - cp src/remembering '$(DESTDIR)$(PREFIX)/bin' - sh doc/manpages.sh -ip '$(DESTDIR)$(MANDIR)' $(manpages) -uninstall: - rm -f '$(DESTDIR)$(PREFIX)/bin/remembering' - sh doc/manpages.sh -up '$(DESTDIR)$(MANDIR)' $(manpages) +## Default target. Builds all artifacts required for testing +## and installation. +all: $(derived-assets) -ALWAYS: +$(libs.a): Makefile deps.mk +$(libs.a): src/$(NAME).go src/meta.go + + +$(fuzz/lib.a): + go tool compile $(GOCFLAGS) -o $@ -p $(NAME) -d=libfuzzer \ + $*.go src/$(NAME).go src/meta.go + +src/meta.go: Makefile + echo 'package $(NAME)' > $@ + echo 'const Version = "$(VERSION)"' >> $@ + echo 'const Name = "$(NAME)"' >> $@ + echo 'const Date = "$(DATE)"' >> $@ + +$(NAME).bin: src/main.bin + ln -fs src/main.bin $@ + + + +tests.bin-check = \ + tests/main.bin-check \ + $(functional/main.go:.go=.bin-check) \ + +$(tests.bin-check): + $(EXEC)$*.bin + +check-unit: $(tests.bin-check) + + +integration-tests = \ + tests/cli-opts.sh \ + tests/ranking.sh \ + tests/signals.sh \ + +.PRECIOUS: $(integration-tests) +$(integration-tests): $(NAME).bin +$(integration-tests): ALWAYS + sh $@ + +check-integration: $(integration-tests) +check-integration: fuzz -# -# Personal workflow targets -# -dist: - sh aux/workflow/dist.sh -d '$(DATE)' -V '$(VERSION)' -n '$(NAME)' +## Run all tests. Each test suite is isolated, so that a parallel +## build can run tests at the same time. The required artifacts +## are created if missing. +check: check-unit check-integration -public po/po4a.cfg dev-check: - $(MAKE) -f aux/dev.mk $@ \ - en_files='$(manpages.en.in)' \ - manpages.in='$(manpages.in)' \ - md_files="`echo *.??.md`" \ - MAILING_LIST='$(MAILING_LIST)' -public: TODOs.md README.md CHANGELOG.md po/po4a.cfg $(manpages) -po/po4a.cfg: ALWAYS -dev: all check public dev-check +FUZZSEC=1 +fuzz/main.bin-check = $(fuzz/main.go:.go=.bin-check) +$(fuzz/main.bin-check): + $(EXEC)$*.bin --test.fuzztime=$(FUZZSEC)s --test.parallel=$N \ + --test.fuzz='.*' --test.fuzzcachedir=tests/fuzz/corpus + +fuzz: $(fuzz/main.bin-check) + + + +benchmarks/main.bin-check = $(benchmarks/main.go:.go=.bin-check) +$(benchmarks/main.bin-check): + printf '%s\n' '$(EXEC)$*.bin' > $*.txt + LANG=POSIX.UTF-8 time -p $(EXEC)$*.bin 2>> $*.txt + printf '%s\n' '$*.txt' + +bench: $(benchmarks/main.bin-check) + + + +## Remove *all* derived artifacts produced during the build. +## A dedicated test asserts that this is always true. +clean: + rm -rf $(derived-assets) $(side-assets) + + +## Installs into $(DESTDIR)$(PREFIX). Its dependency target +## ensures that all installable artifacts are crafted beforehand. +install: all + mkdir -p \ + '$(DESTDIR)$(BINDIR)' \ + '$(DESTDIR)$(GOLIBDIR)' \ + '$(DESTDIR)$(SRCDIR)' \ + + cp $(NAME).bin '$(DESTDIR)$(BINDIR)'/$(NAME) + cp src/$(NAME).a '$(DESTDIR)$(GOLIBDIR)' + cp $(sources) '$(DESTDIR)$(SRCDIR)' + for f in $(manpages); do \ + n=`basename "$$f"`; \ + section=$${n##*.}; \ + mkdir -p '$(DESTDIR)$(MANDIR)'/man$$section; \ + cp "$$f" '$(DESTDIR)$(MANDIR)'/man$$section; \ + done + +## Uninstalls from $(DESTDIR)$(PREFIX). This is a perfect mirror +## of the "install" target, and removes *all* that was installed. +## A dedicated test asserts that this is always true. +uninstall: + rm -rf \ + '$(DESTDIR)$(BINDIR)'/$(NAME) \ + '$(DESTDIR)$(GOLIBDIR)'/$(NAME).a \ + '$(DESTDIR)$(SRCDIR)' \ + + for f in $(manpages); do \ + n=`basename "$$f"`; \ + section=$${n##*.}; \ + rm -f '$(DESTDIR)$(MANDIR)'/man$$section/$$n; \ + done + + + +ALWAYS: diff --git a/README.md b/README.md deleted file mode 100644 index a44abf6..0000000 --- a/README.md +++ /dev/null @@ -1,148 +0,0 @@ -# remembering - -[pt][pt1] | [fr][fr1] | [eo][eo1] - -[pt1]: https://euandreh.xyz/remembering/pt/ -[fr1]: https://euandreh.xyz/remembering/fr/ -[eo1]: https://euandreh.xyz/remembering/eo/ - -Add memory to [`dmenu`][dmenu], [`fzf`][fzf] and similar tools. - -It can wrap such tools to accumulate preferences over time, and -re-arrange the input according to common picks. - - -## Usage - -Replace: -```shell -$ ls | fzf -``` - -with: -```shell -$ ls | remembering -p fzf-sample -c fzf -``` - -and see your previous choices from `fzf` start to appear at the beginning of the list. - -Similar to [`yeganesh`][yeganesh], but with no build-time or run-time dependencies, and not coupled with `dmenu`. - -[dmenu]: https://tools.suckless.org/dmenu/ -[fzf]: https://github.com/junegunn/fzf -[yeganesh]: http://dmwit.com/yeganesh/ - - -## Installation - -```shell -$ make -$ make check -# make install -``` - -You can pass `PREFIX` or `DESTDIR` to `make`: - -```shell -$ make -$ make check -$ make install PREFIX=$HOME/.local -``` - -There are no dependencies or requirements, only standard tools such as -POSIX sed, POSIX make, etc. - - -## Documentation - -### Manuals - -The documentation is available via installed manpages or online: -- [`remembering.1`] ([pt][pt.1], [fr][fr.1], [eo][eo.1]); -- [`remembering.5`] ([pt][pt.5], [fr][fr.5], [eo][eo.5]). - -[`remembering.1`]: https://euandreh.xyz/remembering/en/remembering.1.html -[pt.1]: https://euandreh.xyz/remembering/pt/remembering.1.html -[fr.1]: https://euandreh.xyz/remembering/fr/remembering.1.html -[eo.1]: https://euandreh.xyz/remembering/eo/remembering.1.html -[`remembering.5`]: https://euandreh.xyz/remembering/en/remembering.5.html -[pt.5]: https://euandreh.xyz/remembering/pt/remembering.5.html -[fr.5]: https://euandreh.xyz/remembering/fr/remembering.5.html -[eo.5]: https://euandreh.xyz/remembering/eo/remembering.5.html - -### Directory structure - -The directory structure of the repository is: -- `aux/`: personal scripts and helpers I've vendored in to ensure the - repository is self contained, feel free to ignore it; -- `doc/`: manpages, with their translated versions; -- `po/`: gettext `.po` files for the translated languages and hunspell - dictionaries for spell checking; -- `src/`: main source code for the project; -- `tests/`: integration tests for the project. - - -## Contributing - -Extra tools used for development are: -- [Valgrind] for memory testing; -- [ShellCheck] for validating scripts; -- [po4a], [mdpo] and [gettext] for i18n and l10n support; -- [makefile2graph] and [graphviz] for generating [makefile.svg]; -- [pandoc] for generating the documentation HTML and website. - -[Valgrind]: https://valgrind.org -[ShellCheck]: https://www.shellcheck.net/ -[po4a]: https://po4a.org/index.php.en -[gettext]: https://www.gnu.org/software/gettext/ -[pandoc]: https://pandoc.org/ -[mdpo]: https://mdpo.readthedocs.io/en/master/ -[makefile2graph]: https://github.com/lindenb/makefile2graph -[graphviz]: https://graphviz.org/ -[makefile.svg]: https://euandreh.xyz/git-permalink/makefile.svg - -For running the extra development-only checks, run: - -```shell -$ make dev-check -``` - -and for generating the documentation HTML and website, run: - -```shell -$ make public -``` - -Send contributions to the [mailing list] via -[`git send-email`](https://git-send-email.io/). - - -## Links - -- [homepage](https://euandre.org/s/remembering/en/) -- [source code](https://euandre.org/git/remembering/) -- [bug tracking](https://euandre.org/s/remembering/TODOs.html) -- [mailing list] -- [CI logs](https://euandre.org/s/remembering/ci/) -- [CHANGELOG](https://euandre.org/s/remembering/en/CHANGELOG.html) - -[mailing list]: https://lists.sr.ht/~euandreh/public-inbox?search=%5Bremembering%5D - - -## Releases - -- [v0.3.0](https://euandre.org/git/remembering/commit/?id=v0.3.0) [remembering-v0.3.0.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-v0.3.0.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/remembering-v0.3.0.tar.gz.asc)) - 2022-11-25 -- [v0.2.1](https://euandre.org/git/remembering/commit/?id=v0.2.1) [remembering-v0.2.1.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-v0.2.1.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/remembering-v0.2.1.tar.gz.asc)) - 2021-02-23 -- [v0.2.0](https://euandre.org/git/remembering/commit/?id=v0.2.0) [remembering-v0.2.0.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-v0.2.0.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/remembering-v0.2.0.tar.gz.asc)) - 2021-02-21 -- [v0.1.2](https://euandre.org/git/remembering/commit/?id=v0.1.2) [remembering-v0.1.2.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-v0.1.2.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/remembering-v0.1.2.tar.gz.asc)) - 2021-01-26 -- [v0.1.1](https://euandre.org/git/remembering/commit/?id=v0.1.1) [remembering-v0.1.1.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-v0.1.1.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/remembering-v0.1.1.tar.gz.asc)) - 2021-01-26 -- [v0.1.0](https://euandre.org/git/remembering/commit/?id=v0.1.0) [remembering-v0.1.0.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-v0.1.0.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/remembering-v0.1.0.tar.gz.asc)) - 2021-01-26 - - -## License - -The code is licensed under -[GNU Affero General Public License v3.0 or later][AGPL-3.0-or-later] -(AGPL-3.0-or-later). - -[AGPL-3.0-or-later]: https://euandre.org/git/remembering/tree/COPYING diff --git a/TODOs.md b/TODOs.md deleted file mode 100644 index b5eb3f2..0000000 --- a/TODOs.md +++ /dev/null @@ -1,358 +0,0 @@ -# Tasks - -## TODO Include one or more C linters in `dev-check` target {#td-80513275-dbb4-adfd-b029-7403cd5fb7d3} -- TODO in 2021-10-03 - ---- - -Initial reference: <https://github.com/caramelomartins/awesome-linters> - -## TODO Add explanation of directory structure to `README.md` {#task-a5c8dd18-b180-2731-601a-e26f137a2740} -- TODO in 2021-08-20 - -## TODO Implement behaviour of `test_pick_inexisting_value` {#task-06c8ef1b-15ed-5932-3391-8c02ff759e7a} -- TODO in 2021-06-28 - -## TODO Add test case for unsorted `STDIN` {#task-f5a3d036-f451-f469-56f6-73274162df8e} -- TODO in 2021-06-28 - -## DONE `test_mkdir_p()` is generating randon directories in `$PWD` instead of `/tmp` {#task-bd165b74-c559-48ee-1d29-eaa906aa0393} -- DONE in 2021-06-28 - - Done in - [`17a6c7bda9ec97c03153ebfabf3a99c9f66dc7f5`](https://git.euandreh.xyz/remembering/commit/?id=17a6c7bda9ec97c03153ebfabf3a99c9f66dc7f5). -- TODO in 2021-06-27 - -## TODO `assert-manpages.sh`: ensure that `$(manpages)` contain everything from `$(manpages.en)` {#task-20f96d7d-2fd8-7a5f-e861-ded565c3b408} -- TODO in 2021-06-27 - -## TODO `malloc` vs `calloc` {#task-b3261473-9d12-9df4-cbfe-c4017ffed709} -- TODO in 2021-06-27 - -## TODO Document `EXIT_STATUS` in manpage for `remembering.1` {#task-013534fe-8839-9de1-ec4a-9d63980fc096} -- TODO in 2021-06-27 - -## TODO Use `strtok(3)` over manually separating strings {#task-44843686-1328-521a-8281-60dbb05f2d3f} -- TODO in 2021-06-22 - -## TODO Translate usage/help and manpages {#task-47d98f68-0dec-f9b2-4d5c-bfe822411477} -- TODO in 2021-06-16 - ---- - -Started at -[`a79ced6f0925526ab41ecbdb9e6e8cac86f8ea75`](https://git.euandreh.xyz/remembering/commit/?id=a79ced6f0925526ab41ecbdb9e6e8cac86f8ea75). - -## DONE Also use inline monospaced font in manpages {#task-f1b27444-f824-353e-6e89-63974dcce550} -- DONE in 2021-06-14 - - TIL: use `\fC` (C for "constant-width") for inlined monospace text, as in: `roman text with some \fCcode\fR and more roman text`. - - Done in - [`4c4d45bf92b00756739e5e83372c6aa52c83bc09`](https://git.euandreh.xyz/remembering/commit/?id=4c4d45bf92b00756739e5e83372c6aa52c83bc09). -- TODO in 2021-06-14 - -## DONE Document requirement on STDIN needing to be sorted {#task-ffd35082-5af0-814e-4270-9305f57aa416} -- DONE in 2021-06-13 - - I've added only a small sentence, enough to say that it is at least written somewhere. - - Done in - [`22abb6b88f1a6aa8ba9933d220f6bf3710d0a149`](https://git.euandreh.xyz/remembering/commit/?id=22abb6b88f1a6aa8ba9933d220f6bf3710d0a149). -- TODO in 2021-06-13 - -## DONE Use inline markings over single line "requests" on troff {#task-cb17c58a-bb00-d554-8ed8-1b53eb12b70d} -- DONE in 2021-06-12 - - Done in - [`de7838f0568e0d437822407d46d95e0269a81912`](https://git.euandreh.xyz/remembering/commit/?id=de7838f0568e0d437822407d46d95e0269a81912). -- TODO in 2021-06-12 - -## DONE Use monospace font inside `.EX`/`.EE` tags {#task-fe406a67-e406-41a7-df4a-1e006dc636e9} -- DONE in 2021-06-14 - - Done in - [`231dbf7038efd6a5289444108b4ea36962fe4743`](https://git.euandreh.xyz/remembering/commit/?id=231dbf7038efd6a5289444108b4ea36962fe4743). - - *Update* (2021-06-14): - - Actually the change made in `doc/remembering.*` was done, but I was using `pandoc` to visualize it and not `groff`, and I forgot to update the `Makefile` accordingly. - - Now this was done in - [`fd96f74ebe7032172dbae0056dc399f4bf4a6842`](https://git.euandreh.xyz/remembering/commit/?id=fd96f74ebe7032172dbae0056dc399f4bf4a6842). -- TODO in 2021-06-07 - -## DONE What about UTF-8? {#task-19f9d131-696a-3417-c052-6312f04a33af} -- DONE in 2021-06-06 - - A `test_utf8_commands` was added to verify the behaviour. - Apparently, the current sh code already passes that. - Since I'm not doing any significant string manipulation other than splitting by the `:` separator, it is reasonable to expect it already to work. - - This may also be true for the C implementation: by not really manipulating the string, everything after the `:` separator can be its own thing, and not be handled by remembering at all. - The current code does not really implement that, as test/*.sh isn't even run against it. - But at least the test is already in place so that it prevents regressions from the reimplementation. - - Done in - [`9a9ec634d560b458b216bd1c2a7033c0b7d78339`](https://git.euandreh.xyz/remembering/commit/?id=9a9ec634d560b458b216bd1c2a7033c0b7d78339). -- TODO in 2021-06-06 - ---- - -Does the current sh implementation handle it correctly? -What about the C implementation? - -It would be good to have a test stressing that. - -## CANCELLED Use POSIX `$(CFLAGS)` {#task-4686d9a5-3514-e7f2-25de-b3cf66199124} -- CANCELLED in 2021-06-06 - - I couldn't actually get the flags to work before claiming it to be DONE. - - Instead of just testing on the machines I have at hand right now, it would be much better to have an extensive stress test of portability, compatibility and behaviour across multiple POSIX systems. - - Having [standardify](https://euandre.org/standardify/) would definitely address this. - - Cancelled in - [`32c4ad7eaffa7cac6ab2ea784e3bf60a6dfdaff8`](https://git.euandreh.xyz/remembering/commit/?id=32c4ad7eaffa7cac6ab2ea784e3bf60a6dfdaff8). -- DONE in 2021-06-06 - - - `-std=c99` is interpreted as `-s` + `td=c99`, and a `-t` flag doesn't exist. - Since I'm calling the `c99` command, it implies the C99 C standard, and the consumer should make sure of that. - - `-W*` doesn't exist, neither for `-Wall` nor for `-Wl,-rpath,$$LIBRARY_PATH`; - - `-fPIC` doesn't exist; - - `-O3` is optional and "may be supported". - I picked `-O1` which is defined by the specification, without meaning of which optimizations will be performed; - - I can also have all of this overriden in development with `make -e`, and switch compilers and flags for different errors, warnings, etc. - - Consumers can do the same with `make CFLAGS='...'` and similar strategies. - - Done in - [`107d9fa6012a9312bcee9da0bf86e6fa7a34cfef`](https://git.euandreh.xyz/remembering/commit/?id=107d9fa6012a9312bcee9da0bf86e6fa7a34cfef). -- TODO in 2021-06-06 - ---- - -The current values for `$(CFLAGS)` in the `Makefile` work on GCC, Clang, TinyCC, but not on POSIX `c99`. - -## TODO Can't test getopt {#task-2c3021db-7ede-c835-691a-af240c11f883} -- TODO in 2021-03-10 - ---- - -For some reason, `getopt.3` doesn't read any of the options provided in the test. - -Right now the code is disabled with an [`#ifdef DISABLE`](https://git.euandreh.xyz/remembering/tree/src/remembering.c?id=461f0254ccdc4af66c1d2bfd1f34dbec0ef59218#n189) guard. - -## DONE Add --version flag {#task-b001c31a-5053-d317-d8d3-c9647aa34067} -- DONE In 2021-03-10 - - Done in - [`f93524f531b9da19dc8f4d46dd4977fbbdc80f58`](https://git.euandreh.xyz/remembering/commit/?id=f93524f531b9da19dc8f4d46dd4977fbbdc80f58). -- TODO in 2021-03-09 - -## TODO Add AddressSanitizer and fuzzer tests {#task-8af5055c-d1e1-beba-128c-4cabc40e8057} -- TODO in 2021-03-08 - ---- - -Rich discussion on AddressSanitizer and similar tools: <https://news.ycombinator.com/item?id=26713037>. - -Relevant tools: -- [scan-build](https://clang-analyzer.llvm.org/scan-build.html) -- [sanitizers](https://github.com/google/sanitizers/) -- [GCC analyzer](https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html) - - -## DONE Add $HOME and $XDG_DATA_HOME sh test {#task-9291a8c1-4ac3-409d-b490-872b29a719cc} -- DONE in 2021-03-06 - - Done in - [`5d999a92d6e86fd18c9bcd459e4ebf4fb356bfd5`](https://git.euandreh.xyz/remembering/commit/?id=5d999a92d6e86fd18c9bcd459e4ebf4fb356bfd5). -- TODO in 2021-03-03 - -## CANCELLED Rename PROFILE for LABEL? {#task-e3153cfb-b77a-4528-afa0-43b90f267d3d} -- CANCELLED in 2021-03-06 - - Nope. - - "Profile" is descriptive enough, and, more importantly, it doesn't break anything. -- TODO in 2021-01-31 - ---- - -I feel a more descriptive name could be given. - -Current candidates are: -- tag -- label -- name - -## TODO Make `test_really_long_list` runnable {#task-c1129666-b373-4b9d-8e10-927689048b05} -- TODO in 2021-01-31 - ---- - -Now [`test_really_long_list`](https://git.euandreh.xyz/remembering/tree/tests/ranking.sh?id=f93524f531b9da19dc8f4d46dd4977fbbdc80f58#n314) is commented. - -Benchmark with yeganesh after this is done. - -## CANCELLED Improve speed even further {#task-05c7f068-e935-457f-89ea-1f38227e7779} -- CANCELLED in 2021-03-06 - - [#task-c1129666-b373-4b9d-8e10-927689048b05](#task-c1129666-b373-4b9d-8e10-927689048b05) supersedes this. - And even better: it has runnable code that can be executed for verifying the performance improvement. -- TODO in 2021-01-29 - ---- - -Handle 10k+ lists with ease. - -## CANCELLED Add completion script {#task-daa4a3e7-bcb4-4fe1-a0df-e73c7d17e43c} -- CANCELLED in 2021-03-06 - - Since there are only 2 relevant options (`-p` and `-c`) and descriptive manpages, the cost/benefit for adding code for handling completion isn't worth it. - Worse is better. -- TODO in 2021-01-29 - ---- - -How to support multiple shells without duplicating the code? - -The major one is Bash, but also consider zsh and fish. Also tcsh and oilsh. - -## DONE Is tac POSIX {#task-98478c0f-97ac-4667-acdc-9373e2841de9} -- DONE in 2021-01-26 -- TODO in 2021-01-26 - ---- - -If it isn't, what to replace it with? - -With [sed](https://unix.stackexchange.com/questions/280685/reverse-sequence-of-a-file-with-posix-tools/280686#comment601716_280686). - -## DONE Add CHANGELOG.md for 0.1.0 {#task-f4258dc4-22aa-408d-a0b1-953f654e0623} -- DONE in 2021-01-26 -- TODO in 2021-01-24 - -## CANCELLED How to preserve to sort order from STDIN {#task-b2c26218-5f21-4efd-afbd-ff6af57a358a} -- CANCELLED in 2021-01-24 - - Don't preserve. - - The "blank" order, when remembering doesn't have any date on the input (usually a new profile), is to sort the input data, and it should be this way. - Otherwise the sort order that comes from STDIN would have to be included when showing ranked results, and use the STDIN order as a tie breaker. - - Not only this would make the code much more complex, but also understanding the behaviour of the program harder. -- TODO in 2021-01-24 - ---- - -Keeping the sort order from STDIN, I would have to find a way to -merge STDIN with the existing profile. - -## DONE Make sure to forward status code given by the provided command {#task-47589312-0a4d-46ac-9f13-45309471efeb} -- DONE in 2021-01-24 - - Done in commit - [6f5e467c6bb3f0369e4220be20ab1461cd9334ce](https://git.euandreh.xyz/remembering/commit/?id=6f5e467c6bb3f0369e4220be20ab1461cd9334ce). -- TODO in 2021-01-21 - -## CANCELLED Exclude ponctuation from troff markup {#task-03d0e24c-4baf-404f-ac8a-f8d972ec622e} -- CANCELLED in 2021-01-04 - - Changed in commit - [6748830b5944211104061c6af15612ec270ab5a1](https://git.euandreh.xyz/remembering/commit/?id=6748830b5944211104061c6af15612ec270ab5a1). -- TODO in 2021-01-21 - ---- - -Things like: -```troff -A phrase with the last word -.B bold. -``` - -The final period is marked as bold, too. - -## DONE Add `-h` and `--help` flags {#task-8593b78a-a5ac-4b6c-b9cf-74c021d4a8e5} -- DONE in 2021-01-24 - - Done in commit - [b0f64583bf02f84cadcfad9b610d9c02ec6c4ec2](https://git.euandreh.xyz/remembering/commit/?id=b0f64583bf02f84cadcfad9b610d9c02ec6c4ec2). -- TODO in 2021-01-21 - -## DONE Optimize for large lists {#task-fec292ff-b9de-4d6c-b156-a9adc4771f35} -- DONE in 2021-01-26 - - Instead of using `while read VAR < $FILE`, and looping through each record, - the `$MERGED` and `$FILTERED` files are built differently. - - Building the `$MERGED` file exploits the fact that `sort -u -k2,2` picks the first - entry it sees, regardless of what is in column 1, or other columns. With that, - we feed the reversed (with `tac`) list to it, and `$MERGED` is built in a single - pass of sort. - - Building the `$FILTERED` file is now done with a simple AWK script, that performs much - better that a `while read VAR < $FILE` loop. - - Done in commit - [000b74b1140f2ac41cb5d00a9070db735abdc9c4](https://git.euandreh.xyz/remembering/commit/?id=000b74b1140f2ac41cb5d00a9070db735abdc9c4). -- TODO in 2021-01-21 - -## DONE Add tests {#task-146fab37-e53b-489e-95d0-3fcdd4c3eaef} -- DONE in 2021-01-24 - - Finished in commit - [ee6bc4f2ce6da48f25a29931a178159e5801b5d9](https://git.euandreh.xyz/remembering/commit/?id=ee6bc4f2ce6da48f25a29931a178159e5801b5d9). -- TODO in 2021-01-21 - ---- - -On plain POSIX sh. - -# Bugs - -# Improvements - -## TODO Respond to UNIX signals {#improvement-971e21e1-1083-7507-2379-8e3127a8e359} -- TODO in 2021-06-13 - -## TODO Work on portability {#improvement-f7317d52-012d-7f94-e699-aec7c84329b0} -- TODO in 2021-06-13 - ---- - -Resources on writing portable C code: - -- [Portability is Reliability](https://evan.nemerson.com/2021/05/04/portability-is-reliability/) -- [Why is C called a portable language?](https://www.quora.com/Why-is-C-called-a-portable-language-2?share=1) - -## TODO Learn about secure programming in C {#improvement-8dfd18cf-2c34-ee29-e6cd-53d300687789} -- TODO in 2021-06-13 - ---- - -The best reference by far I've found to learn about secure programming in C is the [SEI CERT C Coding Standard](https://wiki.sei.cmu.edu/confluence/display/c/SEI+CERT+C+Coding+Standard). - -There's also [MISRA C](https://en.wikipedia.org/wiki/MISRA_C) but it feels like very corp. - -# Questions - -## TODO Use more `const` in the implementation? {#question-9ad11485-c244-bf17-f83b-b627db09fab4} -- TODO in 2021-06-15 - -# Resources - -# Scratch -add why, etc. manpages -add -X option, that deletes from the profile what isn't in STDIN -FIXME markers -manpage footers translations -exercise dist.sh -repo.sh check -spelling.sh check -buffer output of tests/*.sh files -does 'sort -m' solve the performance problem? -add spaces to mkstemp()? diff --git a/aux/.gitignore b/aux/.gitignore deleted file mode 100644 index 5588aca..0000000 --- a/aux/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/generated.mk -/preamble-md -/checks/manpages/*.0 diff --git a/aux/80-columns.sh b/aux/80-columns.sh deleted file mode 100755 index ae4660e..0000000 --- a/aux/80-columns.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -set -eu - -# shellcheck disable=2068 -for f in ${@:-$(cat -)}; do - if [ "$(file -i "$f" | cut -d' ' -f2 | cut -d/ -f1)" = 'text' ]; then - sed 's/\t/ /g' "$f" | - awk -v FNAME="$f" 'length > 80 { - printf "%s:%s:%s\n", FNAME, NR, $0 - }' - fi -done diff --git a/aux/checks/changelog.sh b/aux/checks/changelog.sh deleted file mode 100755 index a73baec..0000000 --- a/aux/checks/changelog.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh -set -eu - - -while getopts 'h' flag; do - case "$flag" in - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -. aux/lib.sh - - -HOMEPAGE_LINK="Changelog for [$NAME](https://$DOMAIN/$NAME/en/)." - -if ! grep -qF "$HOMEPAGE_LINK" CHANGELOG.md; then - echo "Missing link to homepage in CHANGELOG.md:" >&2 - echo "$HOMEPAGE_LINK" - exit 1 -fi - -assert() { - DATE="$1" - VVERSION="$2" - VERSION="${2#v}" - CHANGELOG_ENTRY="$(printf \ - '# [%s](https://%s/git/%s/commit/?id=%s) - %s' \ - "$VERSION" "$DOMAIN" "$NAME" "$VVERSION" "$DATE")" - if ! grep -qF "$CHANGELOG_ENTRY" CHANGELOG.md; then - echo "Missing '$CHANGELOG_ENTRY' entry from CHANGELOG.md" >&2 - exit 1 - fi -} - -for VVERSION in $(git tag); do - DATE="$(git log -1 --format=%ad --date=short "$VVERSION")" - assert "$DATE" "$VVERSION" -done - -# FIXME -# "$@" represents a list of tags to be also included in the verification. -for VVERSION in "$@"; do - DATE="$(date '+%Y-%m-%d')" - assert "$DATE" "$VVERSION" -done diff --git a/aux/checks/manpages.sh b/aux/checks/manpages.sh deleted file mode 100755 index 204d960..0000000 --- a/aux/checks/manpages.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -set -eu - -while getopts 'h' flag; do - case "$flag" in - h) - usage - help - exit - ;; - *) - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -. aux/lib.sh - - -# FIXME diff --git a/aux/checks/manpages/footer.en.0.in b/aux/checks/manpages/footer.en.0.in deleted file mode 100644 index 5b51ab5..0000000 --- a/aux/checks/manpages/footer.en.0.in +++ /dev/null @@ -1,30 +0,0 @@ -.SH AUTHORS - -.MT eu@euandre.org -EuAndreh -.ME -and contributors. - - -.SH BUGS - -.IP \(bu -Report bugs to the -.MT ~euandreh/@MAILING_LIST@@lists.sr.ht -mailing list -.ME . -Use the subject "\f(CR[@NAME@] BUG or TASK: -<description>\fR". -.IP \(bu -Browse bugs -.UR https://@DOMAIN@/@NAME@/TODOs.html -online -.UE . -.IP \(bu -.UR https://@DOMAIN@/@NAME@/en/ -Homepage -.UE . -.IP \(bu -.UR https://lists.sr.ht/~euandreh/@MAILING_LIST@?search=%5B@NAME@%5D -Comments and discussions -.UE . diff --git a/aux/checks/manpages/footer.eo.0.in b/aux/checks/manpages/footer.eo.0.in deleted file mode 100644 index fc9fe56..0000000 --- a/aux/checks/manpages/footer.eo.0.in +++ /dev/null @@ -1,13 +0,0 @@ -.SH AUTHORS - -.MT eu@euandre.org EuAndreh .ME and contributors. - - -.SH BUGS - -.IP \(bu Report bugs to the .MT ~euandreh/@MAILING_LIST@@lists.sr.ht mailing -list .ME . Use the subject "\f(CR[@NAME@] BUG or TASK: <description>\fR". -.IP \(bu Browse bugs .UR https://@DOMAIN@/@NAME@/TODOs.html online .UE . .IP -\(bu .UR https://@DOMAIN@/@NAME@/en/ Homepage .UE . .IP \(bu .UR -https://lists.sr.ht/~euandreh/@MAILING_LIST@?search=%5B@NAME@%5D Comments -and discussions .UE . diff --git a/aux/checks/manpages/footer.es.0.in b/aux/checks/manpages/footer.es.0.in deleted file mode 100644 index fc9fe56..0000000 --- a/aux/checks/manpages/footer.es.0.in +++ /dev/null @@ -1,13 +0,0 @@ -.SH AUTHORS - -.MT eu@euandre.org EuAndreh .ME and contributors. - - -.SH BUGS - -.IP \(bu Report bugs to the .MT ~euandreh/@MAILING_LIST@@lists.sr.ht mailing -list .ME . Use the subject "\f(CR[@NAME@] BUG or TASK: <description>\fR". -.IP \(bu Browse bugs .UR https://@DOMAIN@/@NAME@/TODOs.html online .UE . .IP -\(bu .UR https://@DOMAIN@/@NAME@/en/ Homepage .UE . .IP \(bu .UR -https://lists.sr.ht/~euandreh/@MAILING_LIST@?search=%5B@NAME@%5D Comments -and discussions .UE . diff --git a/aux/checks/manpages/footer.fr.0.in b/aux/checks/manpages/footer.fr.0.in deleted file mode 100644 index fc9fe56..0000000 --- a/aux/checks/manpages/footer.fr.0.in +++ /dev/null @@ -1,13 +0,0 @@ -.SH AUTHORS - -.MT eu@euandre.org EuAndreh .ME and contributors. - - -.SH BUGS - -.IP \(bu Report bugs to the .MT ~euandreh/@MAILING_LIST@@lists.sr.ht mailing -list .ME . Use the subject "\f(CR[@NAME@] BUG or TASK: <description>\fR". -.IP \(bu Browse bugs .UR https://@DOMAIN@/@NAME@/TODOs.html online .UE . .IP -\(bu .UR https://@DOMAIN@/@NAME@/en/ Homepage .UE . .IP \(bu .UR -https://lists.sr.ht/~euandreh/@MAILING_LIST@?search=%5B@NAME@%5D Comments -and discussions .UE . diff --git a/aux/checks/manpages/footer.pt.0.in b/aux/checks/manpages/footer.pt.0.in deleted file mode 100644 index fc9fe56..0000000 --- a/aux/checks/manpages/footer.pt.0.in +++ /dev/null @@ -1,13 +0,0 @@ -.SH AUTHORS - -.MT eu@euandre.org EuAndreh .ME and contributors. - - -.SH BUGS - -.IP \(bu Report bugs to the .MT ~euandreh/@MAILING_LIST@@lists.sr.ht mailing -list .ME . Use the subject "\f(CR[@NAME@] BUG or TASK: <description>\fR". -.IP \(bu Browse bugs .UR https://@DOMAIN@/@NAME@/TODOs.html online .UE . .IP -\(bu .UR https://@DOMAIN@/@NAME@/en/ Homepage .UE . .IP \(bu .UR -https://lists.sr.ht/~euandreh/@MAILING_LIST@?search=%5B@NAME@%5D Comments -and discussions .UE . diff --git a/aux/checks/readme.sh b/aux/checks/readme.sh deleted file mode 100755 index f97b2d3..0000000 --- a/aux/checks/readme.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/sh -set -eu - -while getopts 'h' flag; do - case "$flag" in - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -. aux/lib.sh - - -EXPECTED="$(mkstemp)" -cat <<-EOF >> "$EXPECTED" - - Send contributions to the [mailing list] via - [\`git send-email\`](https://git-send-email.io/). - - - ## Links - - - [homepage](https://$DOMAIN/s/$NAME/en/) - - [source code](https://$DOMAIN/git/$NAME/) - - [bug tracking](https://$DOMAIN/s/$NAME/TODOs.html) - - [mailing list] - - [CI logs](https://$DOMAIN/s/$NAME/ci/) - - [CHANGELOG](https://$DOMAIN/s/$NAME/en/CHANGELOG.html) - - [mailing list]: https://lists.sr.ht/~euandreh/$MAILING_LIST?search=%5B$NAME%5D -EOF - -RELEASES_LIST="$(mkstemp)" -add_release() { - DATE="$1" - VVERSION="$2" - echo "- [$VVERSION](https://$DOMAIN/git/$NAME/commit/?id=$VVERSION) [$NAME-$VVERSION.tar.gz](https://$DOMAIN/git/$NAME/snapshot/$NAME-$VVERSION.tar.gz) ([sig](https://$DOMAIN/git/$NAME/snapshot/$NAME-$VVERSION.tar.gz.asc)) - $DATE" >> "$RELEASES_LIST" -} - -for VVERSION in $(git tag); do - DATE="$(git log -1 --format=%ad --date=short "$VVERSION")" - add_release "$DATE" "$VVERSION" -done - -# "$@" represents a list of tags to be also included in the verification. -for VVERSION in "$@"; do - if ! git tag | grep -qF "$VVERSION"; then - DATE="$(date '+%Y-%m-%d')" - add_release "$DATE" "$VVERSION" - fi -done - -if [ -s "$RELEASES_LIST" ]; then - printf '\n\n## Releases\n\n' >> "$EXPECTED" - sort -r "$RELEASES_LIST" >> "$EXPECTED" -fi - -cat <<-EOF >> "$EXPECTED" - - - ## License - - The code is licensed under - [GNU Affero General Public License v3.0 or later][AGPL-3.0-or-later] - (AGPL-3.0-or-later). - - [AGPL-3.0-or-later]: https://$DOMAIN/git/$NAME/tree/COPYING -EOF - -if ! tail -n "$(wc -l < "$EXPECTED")" README.md | diff - "$EXPECTED"; then - echo 'Wrong metadata at the end of README.md file' - echo "See expected content at: $EXPECTED" - exit 1 -fi diff --git a/aux/checks/repo.env b/aux/checks/repo.env deleted file mode 100644 index 79b46d9..0000000 --- a/aux/checks/repo.env +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -export EXECUTABLES=1 -export SYMLINKS=2 -export FILES=9 diff --git a/aux/checks/repo.sh b/aux/checks/repo.sh deleted file mode 100755 index 323f68e..0000000 --- a/aux/checks/repo.sh +++ /dev/null @@ -1,188 +0,0 @@ -#!/bin/sh -set -eu - - -if [ -n "${RECURSIVE_CHECK:-}" ]; then - exit -fi -export RECURSIVE_CHECK=true - -. aux/lib.sh -. aux/checks/repo.env -set -eu - -usage() { - cat <<-'EOF' - FIXME - EOF -} - -assert_no_diffs() { - if [ -n "$(git status -s)" ]; then - echo 'Repository left dirty.' >&2 - git status >&2 - exit 1 - fi -} - -assert_installed_files() { - ACTUAL="$(find "$1" -type f -perm -u=x | wc -l)" - if [ "$EXECUTABLES" != "$ACTUAL" ]; then - printf 'Expected %s executables, found %s:\n' \ - "$EXECUTABLES" "$ACTUAL" >&2 - echo "find $1 -type f -perm -u=x:" >&2 - find "$1" -type f -perm -u=x >&2 - exit 1 - fi - - ACTUAL="$(find "$1" -type l | wc -l)" - if [ "$SYMLINKS" != "$ACTUAL" ]; then - printf 'Expected %s symlinks, found %s:\n' \ - "$SYMLINKS" "$ACTUAL" >&2 - echo "find $1 -type l:" >&2 - find "$1" -type l >&2 - exit 1 - fi - - ACTUAL="$(find "$1" -type f | wc -l)" - if [ "$FILES" != "$ACTUAL" ]; then - printf 'Expected %s files, found %s:\n' \ - "$FILES" "$ACTUAL" >&2 - echo "find $1 -type f:" >&2 - find "$1" -type f >&2 - exit 1 - fi -} - -assert_uninstalled_files() { - if [ "$(find "$1" \( -type f -o -type l \) | wc -l)" != 0 ]; then - echo 'Left-over files after uninstall' >&2 - echo "find $1 \( -type f -o -type l \):" - find "$1" \( -type f -o -type l \) - exit 1 - fi -} - -assert_install() { - make clean - - echo 'Asserting "canonical" install path' >&2 - INSTALL1="$(tmpname)" - make PREFIX="$INSTALL1" - make check PREFIX="$INSTALL1" - make install PREFIX="$INSTALL1" - assert_installed_files "$INSTALL1" - make uninstall PREFIX="$INSTALL1" - assert_uninstalled_files "$INSTALL1" - - make clean - - echo 'Asserting "straigh-forward" install path' >&2 - INSTALL2="$(tmpname)" - make install PREFIX="$INSTALL2" - assert_installed_files "$INSTALL2" - make uninstall PREFIX="$INSTALL2" - assert_uninstalled_files "$INSTALL2" - - make clean - - echo 'Asserting "idempotent" install path' >&2 - INSTALL3="$(tmpname)" - make install PREFIX="$INSTALL3" - make install PREFIX="$INSTALL3" - assert_installed_files "$INSTALL3" - make uninstall PREFIX="$INSTALL3" - make uninstall PREFIX="$INSTALL3" - assert_uninstalled_files "$INSTALL3" - - make clean - - echo 'Asserting "destdir" install path' >&2 - DESTDIR="$(tmpname)" - INSTALL4="$(tmpname)" - make install DESTDIR="$DESTDIR" PREFIX="$INSTALL4" - assert_installed_files "$DESTDIR/$INSTALL4" - make uninstall DESTDIR="$DESTDIR" PREFIX="$INSTALL4" - assert_uninstalled_files "$DESTDIR/$INSTALL4" -} - -check_clean_clone() { - um - unreachable - return 12 - oijwsx - CLONEDIR="$(tmpname)/$NAME" - mkdir -p -- "$CLONEDIR" - cd "$CLONEDIR" - - git clone "$OLDPWD" . - - make dev - assert_no_diffs - make clean - assert_no_diffs - - if [ -n "$(git clean -ffdx --dry-run)" ]; then - echo '"make clean" left files:' >&2 - git clean -ffdx --dry-run >&2 - echo "Clone directory: $CLONEDIR" >&2 - exit 1 - fi - - rm -rf aux/ - make check || { - echo 'Cannot run "make check" without "aux/".' >&2 - echo "Clone directory: $CLONEDIR" >&2 - exit 1 #FIXME - } - - assert_install - oijwsx - - cd - > /dev/null -} - -check_clean_checkout() { - set -x - echo dois - dois - CHECKOUTDIR="$(tmpname)/$NAME" - mkdir -p -- "$CHECKOUTDIR" - git --work-tree="$CHECKOUTDIR" checkout HEAD -- . - cd "$CHECKOUTDIR" - - FILECOUNT="$(find . -type f | wc -l)" - : make clean public dev-check - : make clean - if [ "$FILECOUNT" != "$(find . -type f | wc -l)" ]; then - echo 'File count mismatch after "make clean".' >&2 - echo "Checkout directory: $CHECKOUTDIR" >&2 - exit 1 - fi - - assert_insta - - cd - > /dev/null -} - -set -eu -# set -eE -D="$(mkdtemp)" - -check_clean_clone && echo aaa -exit -if ! check_clean_clone; then - touch "$D"/clean-clone.err -fi -check_clean_clone -# || touch "$D"/clean-clone.err -# check_clean_checkout || touch "$D"/clean-checkout.err -# check_no_aux -wait -tree "$D" -if [ "$(find "$D" -name '*.err' | wc -l)" != 0 ]; then - find "$D" -name '*.err' | while read -r f; do - cat -- "${f%.err}" - done - exit 1 -fi diff --git a/aux/checks/shellcheck.sh b/aux/checks/shellcheck.sh deleted file mode 100755 index 585a75f..0000000 --- a/aux/checks/shellcheck.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -set -eu - -git ls-files | - xargs awk '/^#!\/bin\/sh$/ { print FILENAME } { nextfile }' | - xargs shellcheck -x diff --git a/aux/checks/spelling.sh b/aux/checks/spelling.sh deleted file mode 100755 index 02f9051..0000000 --- a/aux/checks/spelling.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -set -eu - -# echo FIXME -exit diff --git a/aux/checks/todos.sh b/aux/checks/todos.sh deleted file mode 100755 index 2b9a570..0000000 --- a/aux/checks/todos.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh -set -eu - -if true; then - exit -fi - -if [ -e .git ] && git grep FIXME | grep -v '^TODOs.md' | - grep -v '^aux/workflow/assert-todos.sh'; then - echo "Found dangling FIXME markers on the project." - echo "You should write them down properly on TODOs.md." - exit 1 -fi - -awk -F'{#' ' -BEGIN { - exitstatus = 0 - h2flag = 0 - h2status = "" - prevline = "" - idx = 0 - delete ids[0] -} -h2flag == 1 { - split($0, l, " ") - timelinestatus = l[2] - if (h2status != timelinestatus) { - print "h2/timeline status mismatch for line " NR-1 - print prevline - print $0 - exitstatus = 1 - } - h2status = "" - h2flag = 0 -} - -/^## (TODO|DOING|WAITING|MEETING|INACTIVE|NEXT|CANCELLED|DONE|WONTFIX)/ { - if (match($0, / \{#.*?\}.*$/) == 0) { - print "Missing ID for line " NR ":\n" $0 - exitstatus = 1 - } - id_with_prefix = substr($2, 0, length($2) - 1) - match(id_with_prefix, /^\w+-/) - id = substr(id_with_prefix, RLENGTH + 1) - if (id in arr) { - print "Duplicate ID: " id - exitstatus = 1 - } else { - arr[id] = 1 - } - - split($0, l, " ") - h2status = l[2] - h2flag = 1 - prevline = $0 -} - - -/^# Scratch$/ { - exit exitstatus -} -' TODOs.md diff --git a/aux/dev.mk b/aux/dev.mk deleted file mode 100644 index 5f62802..0000000 --- a/aux/dev.mk +++ /dev/null @@ -1,113 +0,0 @@ -.POSIX: - -.SUFFIXES: -.SUFFIXES: .in .md .html - -.in: - sed \ - -e "s:@DOMAIN@:`cat aux/domain.txt`:g" \ - -e "s:@NAME@:`basename "$$PWD"`:g" \ - -e 's:@MAILING_LIST@:$(MAILING_LIST):g' \ - < $< > $@ - -.in.html: - pandoc -s -r man -w html \ - -H aux/headers.html \ - --metadata lang="`echo $< | awk -F. '{ print $$(NF-2) }'`" \ - < $(<D)/`basename "$(<F)" .in` > $@ - -.md.html: - pandoc -s -r commonmark -w html \ - -H aux/headers.html \ - --metadata lang="`echo $(<F) | cut -d. -f2`" \ - --metadata title="`basename "$$PWD"` - `echo $(<F) | cut -d. -f1`" \ - --toc --toc-depth=2 \ - --highlight-style pygments \ - < $< > $@ - -manpages.html = $(manpages.in:.in=.html) - -md_files.html = $(md_files:.md=.html) - -public: manpages.sentinel public/makefile.svg md.sentinel public/index.html \ - public/ci public/TODOs.html public/style.css public/favicon.svg - touch $@ - -public/index.html: - mkdir -p $(@D) - ln -rs public/en/index.html $@ - -public/ci: - sh aux/ci/report.sh -n "`basename "$$PWD"`" -o $@ - -public/TODOs.html: TODOs.md aux/preamble-md - mkdir -p $(@D) - td -H | cat aux/preamble-md - | pandoc -s -r commonmark -w html \ - -H aux/headers.html \ - --metadata lang=en \ - --metadata title="`basename "$$PWD"` - TODOs" \ - --toc --toc-depth=2 \ - --highlight-style pygments \ - > $@ - -public/favicon.svg: aux/favicon.svg - mkdir -p $(@D) - cp aux/favicon.svg $@ - -public/style.css: - mkdir -p $(@D) - td -S > $@ - -md.sentinel: $(md_files.html) - mkdir -p public - sh aux/ext2subdir.sh -o public $? - for d in public/*/; do ln -rfs public/style.css $$d/style.css; done - touch $@ - -manpages.sentinel: $(manpages.html) - mkdir -p public - sh aux/ext2subdir.sh -o public $? - touch $@ - -public/makefile.svg: Makefile - mkdir -p $(@D) - LANG=en.UTF-8 make -Bnd dev | make2graph | dot -Tsvg >$@ - - -index.en.md: - ln -s README.md $@ - -CHANGELOG.en.md: - ln -s CHANGELOG.md $@ - -all_en_files = \ - $(en_files) \ - index.en.md \ - CHANGELOG.en.md - -po/po4a.cfg: $(all_en_files) po - sh aux/po4a-cfg.sh -f '$(all_en_files) aux/checks/manpages/footer.en.0.in' > $@ - po4a $@ - - -test-files = \ - aux/checks/changelog.sh \ - aux/checks/manpages.sh \ - aux/checks/readme.sh \ - aux/checks/shellcheck.sh \ - aux/checks/spelling.sh \ - aux/checks/todos.sh \ - aux/checks/repo.sh \ - -$(test-files): ALWAYS manfooter.sentinel - env MAILING_LIST='$(MAILING_LIST)' sh $@ - -aux/checks/assert-manpages.sh: manfooter.sentinel - -manfooter.sentinel: - $(MAKE) -f aux/dev.mk `echo aux/checks/manpages/*.in | sed 's|\.in||g'` - touch $@ - -dev-check: $(test-files) - -ALWAYS: diff --git a/aux/dist.sh b/aux/dist.sh deleted file mode 100755 index def68e6..0000000 --- a/aux/dist.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - EOF -} - -while getopts 'd:V:n:' flag; do - case "$flag" in - d) - DATE="$OPTARG" - ;; - V) - VVERSION="v$OPTARG" - ;; - n) - NAME="$OPTARG" - ;; - *) - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -. aux/lib.sh - -eval "$(assert_arg "${DATE:-}" '-d DATE')" -eval "$(assert_arg "${VVERSION:-}" '-V VERSION')" -eval "$(assert_arg "${NAME:-}" '-n NAME')" - - -if [ "$(git rev-parse --abbrev-ref HEAD)" != 'main' ]; then - echo 'Not on branch "main".' >&2 - exit 1 -fi - -if git show "$VVERSION" 1>/dev/null 2>/dev/null; then - echo "Version '$VVERSION' already exists." >&2 - exit 1 -fi - -if ! printf '%s\n%s\n' "$(git tag)" "$VVERSION" | sort -nct. -k1 -k2 -k3; then - echo 'New tag is not bigger than existing ones.' >&2 - exit 1 -fi - -if [ "$DATE" != "$(git log -1 --format=%ad --date=short HEAD)" ]; then - echo "Date '$DATE' is not up-to-date." >&2 - exit 1 -fi - -if [ "Release $VVERSION" != "$(git log --format=%B -1 HEAD | head -n1)" ]; then - echo "Commit message isn't 'Release $VVERSION'." >&2 - exit 1 -fi - -# FIXME -: make clean check EXTRA_VERSION="$VVERSION" - -if ! (git diff --quiet && git diff --quiet --staged); then - echo 'Dirty repository.' - exit 1 -fi - - -git tag "$VVERSION" -sh aux/workflow/sign-tarballs.sh -n "$NAME" - - -printf 'Publish version? [Y/n]: ' >&2 -read -r publish - -if [ "$publish" = 'n' ]; then - cat <<EOF >&2 -Now push the tag and the signature before pushing the commit: - -git push origin refs/notes/signatures/tar.gz -o ci.skip --no-verify -git push --tags -o ci.skip --no-verify -git push - -EOF -else - git push origin refs/notes/signatures/tar.gz -o ci.skip --no-verify - git push --tags -o ci.skip --no-verify - git push -fi diff --git a/aux/domain.txt b/aux/domain.txt deleted file mode 100644 index fd7ea0f..0000000 --- a/aux/domain.txt +++ /dev/null @@ -1 +0,0 @@ -euandre.org diff --git a/aux/ext2subdir.sh b/aux/ext2subdir.sh deleted file mode 100755 index 4770d1b..0000000 --- a/aux/ext2subdir.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - FIXME - EOF -} - -help() { - cat <<-'EOF' - FIXME - EOF -} - - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -while getopts 'o:h' flag; do - case "$flag" in - o) - OUTDIR="$OPTARG" - ;; - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -. aux/lib.sh - -eval "$(assert_arg "${OUTDIR:-}" '-o OUTDIR')" - - -for f in "$@"; do - lang="$(printf '%s' "$(basename "$f")" | sed 's|^.*\.\([a-z][a-z]\)\..*$|\1|')" - f_nolang="$(printf '%s' "$(basename "$f")" | sed "s|\.$lang\.|.|")" - mkdir -p -- "$OUTDIR/$lang" - cp -- "$f" "$OUTDIR/$lang/$f_nolang" -done diff --git a/aux/favicon.svg b/aux/favicon.svg deleted file mode 100644 index ce566b2..0000000 --- a/aux/favicon.svg +++ /dev/null @@ -1,62 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"> - <path d="M 0 8 L 1 8 L 1 9 L 0 9 L 0 8 Z" /> - <path d="M 0 13 L 1 13 L 1 14 L 0 14 L 0 13 Z" /> - <path d="M 1 8 L 2 8 L 2 9 L 1 9 L 1 8 Z" /> - <path d="M 1 13 L 2 13 L 2 14 L 1 14 L 1 13 Z" /> - <path d="M 2 8 L 3 8 L 3 9 L 2 9 L 2 8 Z" /> - <path d="M 2 13 L 3 13 L 3 14 L 2 14 L 2 13 Z" /> - <path d="M 3 8 L 4 8 L 4 9 L 3 9 L 3 8 Z" /> - <path d="M 3 13 L 4 13 L 4 14 L 3 14 L 3 13 Z" /> - <path d="M 4 7 L 5 7 L 5 8 L 4 8 L 4 7 Z" /> - <path d="M 4 8 L 5 8 L 5 9 L 4 9 L 4 8 Z" /> - <path d="M 4 13 L 5 13 L 5 14 L 4 14 L 4 13 Z" /> - <path d="M 5 6 L 6 6 L 6 7 L 5 7 L 5 6 Z" /> - <path d="M 5 7 L 6 7 L 6 8 L 5 8 L 5 7 Z" /> - <path d="M 5 13 L 6 13 L 6 14 L 5 14 L 5 13 Z" /> - <path d="M 6 5 L 7 5 L 7 6 L 6 6 L 6 5 Z" /> - <path d="M 6 6 L 7 6 L 7 7 L 6 7 L 6 6 Z" /> - <path d="M 6 14 L 7 14 L 7 15 L 6 15 L 6 14 Z" /> - <path d="M 7 1 L 8 1 L 8 2 L 7 2 L 7 1 Z" /> - <path d="M 7 14 L 8 14 L 8 15 L 7 15 L 7 14 Z" /> - <path d="M 7 15 L 8 15 L 8 16 L 7 16 L 7 15 Z" /> - <path d="M 7 2 L 8 2 L 8 3 L 7 3 L 7 2 Z" /> - <path d="M 7 3 L 8 3 L 8 4 L 7 4 L 7 3 Z" /> - <path d="M 7 4 L 8 4 L 8 5 L 7 5 L 7 4 Z" /> - <path d="M 7 5 L 8 5 L 8 6 L 7 6 L 7 5 Z" /> - <path d="M 8 1 L 9 1 L 9 2 L 8 2 L 8 1 Z" /> - <path d="M 8 15 L 9 15 L 9 16 L 8 16 L 8 15 Z" /> - <path d="M 9 1 L 10 1 L 10 2 L 9 2 L 9 1 Z" /> - <path d="M 9 2 L 10 2 L 10 3 L 9 3 L 9 2 Z" /> - <path d="M 9 6 L 10 6 L 10 7 L 9 7 L 9 6 Z" /> - <path d="M 9 15 L 10 15 L 10 16 L 9 16 L 9 15 Z" /> - <path d="M 10 2 L 11 2 L 11 3 L 10 3 L 10 2 Z" /> - <path d="M 10 3 L 11 3 L 11 4 L 10 4 L 10 3 Z" /> - <path d="M 10 4 L 11 4 L 11 5 L 10 5 L 10 4 Z" /> - <path d="M 10 5 L 11 5 L 11 6 L 10 6 L 10 5 Z" /> - <path d="M 10 6 L 11 6 L 11 7 L 10 7 L 10 6 Z" /> - <path d="M 11 6 L 12 6 L 12 7 L 11 7 L 11 6 Z" /> - <path d="M 11 8 L 12 8 L 12 9 L 11 9 L 11 8 Z" /> - <path d="M 10 15 L 11 15 L 11 16 L 10 16 L 10 15 Z" /> - <path d="M 11 10 L 12 10 L 12 11 L 11 11 L 11 10 Z" /> - <path d="M 11 12 L 12 12 L 12 13 L 11 13 L 11 12 Z" /> - <path d="M 11 14 L 12 14 L 12 15 L 11 15 L 11 14 Z" /> - <path d="M 11 15 L 12 15 L 12 16 L 11 16 L 11 15 Z" /> - <path d="M 12 6 L 13 6 L 13 7 L 12 7 L 12 6 Z" /> - <path d="M 12 8 L 13 8 L 13 9 L 12 9 L 12 8 Z" /> - <path d="M 12 10 L 13 10 L 13 11 L 12 11 L 12 10 Z" /> - <path d="M 12 12 L 13 12 L 13 13 L 12 13 L 12 12 Z" /> - <path d="M 12 14 L 13 14 L 13 15 L 12 15 L 12 14 Z" /> - <path d="M 13 6 L 14 6 L 14 7 L 13 7 L 13 6 Z" /> - <path d="M 13 8 L 14 8 L 14 9 L 13 9 L 13 8 Z" /> - <path d="M 13 10 L 14 10 L 14 11 L 13 11 L 13 10 Z" /> - <path d="M 13 12 L 14 12 L 14 13 L 13 13 L 13 12 Z" /> - <path d="M 13 13 L 14 13 L 14 14 L 13 14 L 13 13 Z" /> - <path d="M 13 14 L 14 14 L 14 15 L 13 15 L 13 14 Z" /> - <path d="M 14 7 L 15 7 L 15 8 L 14 8 L 14 7 Z" /> - <path d="M 14 8 L 15 8 L 15 9 L 14 9 L 14 8 Z" /> - <path d="M 14 9 L 15 9 L 15 10 L 14 10 L 14 9 Z" /> - <path d="M 14 10 L 15 10 L 15 11 L 14 11 L 14 10 Z" /> - <path d="M 14 11 L 15 11 L 15 12 L 14 12 L 14 11 Z" /> - <path d="M 14 12 L 15 12 L 15 13 L 14 13 L 14 12 Z" /> -</svg> diff --git a/aux/headers.html b/aux/headers.html deleted file mode 100644 index 1686e45..0000000 --- a/aux/headers.html +++ /dev/null @@ -1,2 +0,0 @@ -<link rel="icon" type="image/svg+xml" href="favicon.svg" /> -<link rel="stylesheet" type="text/css" href="style.css" /> diff --git a/aux/lib.sh b/aux/lib.sh deleted file mode 100644 index 93a37eb..0000000 --- a/aux/lib.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -DOMAIN="$(cat aux/domain.txt)" -NAME="$(basename "$PWD")" -export DOMAIN NAME - -assert_arg() { - if [ -z "$1" ]; then - printf 'Missing %s.\n\n' "$2" >&2 - cat <<-'EOF' - usage >&2 - exit 2 - EOF - fi -} - -uuid() { - od -xN20 /dev/urandom | - head -n1 | - awk '{OFS="-"; print $2$3,$4,$5,$6,$7$8$9}' -} - -tmpname() { - printf '%s/uuid-tmpname-without-spaces.%s' "${TMPDIR:-/tmp}" "$(uuid)" -} - -mkstemp() { - name="$(tmpname)" - touch -- "$name" - printf '%s' "$name" -} - -mkdtemp() { - name="$(tmpname)" - mkdir -p -- "$name" - printf '%s' "$name" -} diff --git a/aux/po4a-cfg.sh b/aux/po4a-cfg.sh deleted file mode 100755 index 11e51aa..0000000 --- a/aux/po4a-cfg.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - FIXME - EOF -} - -help() { - cat <<-'EOF' - FIXME - EOF -} - - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -while getopts 'f:L:h' flag; do - case "$flag" in - f) - FILES="$OPTARG" - ;; - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -. aux/lib.sh - - -files() { - printf '%s' "${FILES:-}" | tr ' ' '\n' | grep . -} - -guess_type() { - case "$1" in - *.md) - echo text - ;; - *.[1-9]*.in) - echo man - ;; - *) - echo text - ;; - esac -} - - -cat <<-'EOF' - [options] --keep 0 --master-charset UTF-8 --localized-charset UTF-8 - - [po_directory] po - -EOF - -files | while read -r file; do - TYPE="$(guess_type "$file")" - # shellcheck disable=2016 - VAR_FILE="$(printf '%s' "$file" | sed 's|\.en\.|.$lang.|')" - # shellcheck disable=2016 - printf '[type: %s] %s $lang:%s\n' "$TYPE" "$file" "$VAR_FILE" -done diff --git a/aux/preamble-md.in b/aux/preamble-md.in deleted file mode 100644 index 2bdf0c2..0000000 --- a/aux/preamble-md.in +++ /dev/null @@ -1,14 +0,0 @@ -# About - -TODOs for [@NAME@](https://@DOMAIN@/@NAME@/en/). - -Register a new one at -<span id="new">[~euandreh/@MAILING_LIST@@lists.sr.ht](mailto:~euandreh/@MAILING_LIST@@lists.sr.ht?subject=%5B@NAME@%5D%20BUG%20or%20TASK%3A%20%3Cdescription%3E)</span> -and see [existing discussions](https://lists.sr.ht/~euandreh/@MAILING_LIST@?search=%5B@NAME@%5D). - -*Você também pode escrever em português*. - -*Vous pouvez aussi écrire en français*. - -*Vi povas ankaŭ skribi esperante*. - diff --git a/aux/sign-tarballs.sh b/aux/sign-tarballs.sh deleted file mode 100755 index 3ab2bb8..0000000 --- a/aux/sign-tarballs.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -set -eu - -while getopts 'n:' flag; do - case "$flag" in - n) - PROJECT="$OPTARG" - ;; - *) - exit 2 - ;; - esac -done -shift $((OPTIND -1)) - -assert_arg() { - if [ -z "$1" ]; then - echo "Missing $2" >&2 - exit 2 - fi -} - -assert_arg "${PROJECT:-}" '-n PROJECT' - - -SIGNATURES="$(git notes --ref=refs/notes/signatures/tar.gz list | cut -d\ -f2)" -for tag in $(git tag); do - COMMIT="$(git rev-list -n1 "$tag")" - if echo "$SIGNATURES" | grep -qF "$COMMIT"; then - continue - fi - echo "Adding missing signature to $tag" >&2 - git notes --ref=refs/notes/signatures/tar.gz add -C "$( - git archive --format tar.gz --prefix "$PROJECT-$tag/" "$tag" | - gpg --output - --armor --detach-sign | - git hash-object -w --stdin - )" "$tag" -done @@ -0,0 +1,60 @@ +libs.go = \ + src/remembering.go \ + tests/benchmarks/ranking-throughput/remembering.go \ + tests/functional/pick-roundtrip/remembering.go \ + tests/fuzz/profile/remembering.go \ + tests/remembering.go \ + +mains.go = \ + src/main.go \ + tests/benchmarks/ranking-throughput/main.go \ + tests/functional/pick-roundtrip/main.go \ + tests/fuzz/profile/main.go \ + tests/main.go \ + +manpages.adoc = \ + doc/remembering.en.1.adoc \ + +functional/lib.go = \ + tests/functional/pick-roundtrip/remembering.go \ + +functional/main.go = \ + tests/functional/pick-roundtrip/main.go \ + +fuzz/lib.go = \ + tests/fuzz/profile/remembering.go \ + +fuzz/main.go = \ + tests/fuzz/profile/main.go \ + +benchmarks/lib.go = \ + tests/benchmarks/ranking-throughput/remembering.go \ + +benchmarks/main.go = \ + tests/benchmarks/ranking-throughput/main.go \ + +src/main.a: src/main.go +src/remembering.a: src/remembering.go +tests/benchmarks/ranking-throughput/main.a: tests/benchmarks/ranking-throughput/main.go +tests/benchmarks/ranking-throughput/remembering.a: tests/benchmarks/ranking-throughput/remembering.go +tests/functional/pick-roundtrip/main.a: tests/functional/pick-roundtrip/main.go +tests/functional/pick-roundtrip/remembering.a: tests/functional/pick-roundtrip/remembering.go +tests/fuzz/profile/main.a: tests/fuzz/profile/main.go +tests/fuzz/profile/remembering.a: tests/fuzz/profile/remembering.go +tests/main.a: tests/main.go +tests/remembering.a: tests/remembering.go +src/main.bin: src/main.a +tests/benchmarks/ranking-throughput/main.bin: tests/benchmarks/ranking-throughput/main.a +tests/functional/pick-roundtrip/main.bin: tests/functional/pick-roundtrip/main.a +tests/fuzz/profile/main.bin: tests/fuzz/profile/main.a +tests/main.bin: tests/main.a +src/main.bin-check: src/main.bin +tests/benchmarks/ranking-throughput/main.bin-check: tests/benchmarks/ranking-throughput/main.bin +tests/functional/pick-roundtrip/main.bin-check: tests/functional/pick-roundtrip/main.bin +tests/fuzz/profile/main.bin-check: tests/fuzz/profile/main.bin +tests/main.bin-check: tests/main.bin +src/main.a: src/$(NAME).a +tests/benchmarks/ranking-throughput/main.a: tests/benchmarks/ranking-throughput/$(NAME).a +tests/functional/pick-roundtrip/main.a: tests/functional/pick-roundtrip/$(NAME).a +tests/fuzz/profile/main.a: tests/fuzz/profile/$(NAME).a +tests/main.a: tests/$(NAME).a diff --git a/description b/description deleted file mode 100644 index f8b2888..0000000 --- a/description +++ /dev/null @@ -1 +0,0 @@ -Add memory to dmenu, fzf and similar tools. diff --git a/doc/manpages.sh b/doc/manpages.sh deleted file mode 100755 index c88e23b..0000000 --- a/doc/manpages.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -set -eu - -while getopts 'iup:' flag; do - case "$flag" in - i) - ACTION=install - ;; - u) - ACTION=uninstall - ;; - p) - MANDIR="$OPTARG" - ;; - *) - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -assert_arg() { - if [ -z "$1" ]; then - echo "Missing $2" >&2 - exit 2 - fi -} - -assert_arg "${ACTION:-}" '[-iu] for choosing action' - -for f in "$@"; do - l="$(echo "$f" | awk -F. '{print $(NF-1)}')" - n="$(echo "$f" | awk -F. '{print $NF}')" - case "$ACTION" in - install) - assert_arg "${MANDIR:-}" '-p MANDIR' - to_name="$(basename "${f%."$l"."$n"}.$n")" - mkdir -p "$MANDIR/$l/man$n" "$MANDIR/man$n" - cp "$f" "$MANDIR/$l/man$n/$to_name" - ln -fs "../en/man$n/$to_name" \ - "$MANDIR/man$n/$to_name" - ;; - uninstall) - assert_arg "${MANDIR:-}" '-p MANDIR' - to_name="$(basename "${f%."$l"."$n"}.$n")" - rm -f \ - "$MANDIR/$l/man$n/$to_name" \ - "$MANDIR/man$n/$to_name" - ;; - *) - echo "Bad ACTION: $ACTION" - exit 2 - ;; - esac -done diff --git a/doc/remembering.en.1.adoc b/doc/remembering.en.1.adoc new file mode 100644 index 0000000..9d5f859 --- /dev/null +++ b/doc/remembering.en.1.adoc @@ -0,0 +1,160 @@ += remembering(1) + + + +== NAME + +remembering - add memory to dmenu, fzf and similar menu tools. + + + +== SYNOPSYS + +*remembering* [_-p PROFILE_] -- _COMMAND_... + + + +== EXAMPLES + + +=== A dmenu launcher that learns + +[source,sh] +.... +$ printf 'firefox\nmpv\nmutt\n' | remembering -p apps -- dmenu +.... + +The first time, the menu comes up alphabetical. Pick `mutt` a few +times and it comes up first. + + +=== Open a file with fzf, most-used first + +[source,sh] +.... +$ ls | remembering -- fzf +.... + +Without _-p_, the profile is derived from the current directory, +so every directory gets its own ranking with no setup. + + + +== DESCRIPTION + +*remembering* sits between a list of choices and the menu tool +that picks from them. It reads the choices from _stdin_, feeds +them to _COMMAND_ sorted by how often each one was picked before, +takes what _COMMAND_ prints as the pick, bumps that pick's count +in the profile, and prints the pick. + +The lines on _stdin_ define what is offered: the profile only +ranks them. Most-picked lines come first; ties are broken in byte +order; never-picked lines keep their byte order at the bottom. + +The pick does not have to be one of the offered lines --- whatever +_COMMAND_ prints is learnt, so menu tools that accept free text +(such as `dmenu`) grow new entries on first use. Lines that were +offered but never picked are remembered with a count of zero, and +profile entries that stop appearing on _stdin_ are kept --- the +profile accumulates the universe of choices it has seen. + +The profile is rewritten atomically (a sibling `.tmp` file plus +rename), so a crash never leaves a half-written profile. + +*remembering* is transparent in pipelines: _COMMAND_'s _stderr_ +(where dmenu and fzf draw their interface) passes through, and its +exit status is forwarded. A cancelled menu --- a nonzero exit --- +aborts the run with the same status and learns nothing. A +successful run that picks nothing (empty output) also learns +nothing, and exits 0. + + + +== OPTIONS + +*-p* _PROFILE_:: +The profile name to gather and store the ranking under (default: +the current directory, with every `/` turned into `!`). + + + +== IO + + +=== STDIN + +The menu choices, one per line, in any order. + + +=== STDOUT + +The pick, when there is one, followed by a newline. _COMMAND_'s +own output is captured, not echoed. + + +=== STDERR + +_COMMAND_'s _stderr_, passed through untouched, and error +messages. + + +=== INPUT AND OUTPUT FILES + +The profile, at: + +[source,sh] +.... +${XDG_DATA_HOME:-$HOME/.local/share}/remembering/$PROFILE +.... + +It is a plain text file with one line per known choice: + +[source,sh] +.... +2 profile firefox +0 profile mpv +7 profile mutt +.... + +The count comes first, the literal word `profile` second, and the +choice's text --- spaces included --- runs to the end of the line. +Lines are kept in byte order, with a newly learnt pick appended at +the end. The file is made to be hand-edited: delete a line to +forget it, edit a count to re-rank it. + + + +== EXIT STATUS + +0:: The pick was learnt and printed, or there was nothing to +learn (empty pick). + +1:: A runtime error, such as an unreadable or unwritable profile. + +2:: Usage error: an unknown option, or a missing _COMMAND_. + +Otherwise, _COMMAND_'s own nonzero exit status, forwarded as-is +(or 128 plus the signal number when it was killed by a signal). + + + +== SEE ALSO + +dmenu(1), fzf(1), sort(1) + + + +== AUTHORS + +mailto:eu@euandre.org[EuAndreh] and contributors. + + + +== BUGS + +* Report bugs to the mailto:~euandreh/public-inbox@lists.sr.ht[mailing list]. + Use the subject "[remembering] BUG or TASK: <description>". +* Browse bugs https://euandre.org/git/remembering/TODOs.html[online]. +* https://euandre.org/git/remembering/[Homepage]. +* https://lists.sr.ht/~euandreh/public-inbox?search=%5Bremembering%5D[Comments and discussions]. diff --git a/doc/remembering.en.1.in b/doc/remembering.en.1.in deleted file mode 100644 index c21b653..0000000 --- a/doc/remembering.en.1.in +++ /dev/null @@ -1,208 +0,0 @@ -.TH REMEMBERING 1 @DATE@ "remembering @VERSION@" - - -.SH NAME - -remembering - sort list from \fISTDIN\fR using past choices as weight. - - -.SH SYNOPSYS - -\fBremembering\fR \fB-p\fR \fIPROFILE\fR \fB-c\fR \fICOMMAND\fR - - -.SH DESCRIPTION - -\fBremembering\fR takes a command that chooses an option as its behaviour, such as \fBfzf\fR(1) or \fBdmenu\fR(1), and \fIremembers\fR what option is chosen, and as it is used, will put the most used choices at the beginning of the list. - -\fBremembering\fR reads from STDIN and writes to STDOUT. -It expects STDIN to be sorted. - - -.SH OPTIONS - -.TP -\fB-c\fR \fICOMMAND\fR -The \fICOMMAND\fR to be executed, reading from standard input (STDIN). - -.TP -\fB-p\fR \fIPROFILE\fR -The name of the \fIPROFILE\fR where to look up and store raking data. - -.TP -\fB-h\fR, \fB--help\fR -Show short help text. - -.TP -\fB-V\fR, \fB--version\fR -Show version number. - - -.SH EXAMPLES - -List current directory and feed it to \fBfzf\fR(1) via \fBremembering\fR: - -.RS -.nf -$ ls | remembering -p fzf-ls -c fzf -.fi -.RE - - -Lists all executables available in \fI$PATH\fR, and feed those to \fBdmenu\fR(1) via \fBremembering\fR, and execute with \fBsh\fR(1) the choice picked: - -.RS -.nf -$ dmenu_path | remembering -p dmenu-exe -c 'dmenu' | sh -.fi -.RE - -.P -Successive invocations will put the frequent choices at the beginning. - -.SS Simulation of an interactive session - -Below is a simulation of an interactive session, comparing the usage of plain \fBfzf\fR(1) against composing it with \fBremembering\fR: - -.RS -.nf -$ mkdir -p example/ -$ cd example/ -$ touch a b c d e -$ ls -a b c d e -$ ls | fzf -.fi -.RE - -We begin creating a sample directory called "\f(CRexample/\fR", we cd into it and create 5 empty files: a, b, c, d and e. - -\f(CRls\fR can list the directory for us, in this case in alphabetical order. - -When we pipe the output of \f(CRls\fR into \fBfzf\fR(1), we are give given its prompt to pick one option: - -.RS -.nf - e - d - c - b -> a - 5/5 -> -.fi -.RE - -Here \fBfzf\fR(1) lists the items it gets from \fISTDIN\fR in the order that it was given, and starts at the first one, "a". - -Once we type "d" and press return, the output of \fBfzf\fR(1) is the choice: - -.RS -.nf -$ ls | fzf -d -.fi -.RE - -Now if we run the same command again, we'll be given the same options, in the same order: - -.RS -.nf -$ ls | fzf - - e - d - c - b -> a - 5/5 -> - -$ ls | fzf -d -.fi -.RE - -\fBfzf\fR(1) is doing what it is told to: making a prompt with the options given to it from \fISTDIN\fR, in the order it was given. - -In order to have our past choices show up in the beginning of the list, we can compose \fBfzf\fR(1) with \fBremembering\fR: - -.RS -.nf -$ ls | remembering -p tutorial-example -c 'fzf' - - e - d - c - b -> a - 5/5 -> - -$ ls | remembering -p tutorial-example -c 'fzf' -d -.fi -.RE - -So far we get the exact same behaviour, but saying extra things. -We tell \fBremembering\fR that we want this specific \fIPROFILE\fR to be called "\f(CRtutorial-example\fR", and we give \fBremembering\fR the \f(CR'fzf'\fR command to be ran. - -From now on if we run the exact same command again, \fBremembering\fR will \fIremember\fR that the last choice was "d", and put it in the beginning of the list, which \fBfzf\fR(1) happily displays in the order it was given: - -.RS -.nf -$ ls | remembering -p tutorial-example -c 'fzf' - - e - c - b - a -> d - 5/5 -> - -$ ls | remembering -p tutorial-example -c 'fzf' -d -.fi -.RE - -This time the "d" option was already the first one, and we can just press return to get it as the output value from the command. - -This example used \fBfzf\fR(1) as the \fICOMMAND\fR given to \fBremembering\fR, but you can give to the \fB-c\fR option anything that reads from \fISTDIN\fR, picks a line and writes to \fBSTDOUT\fR. - - -.SH SEE ALSO - -\fBremembering\fR(5) - - -.SH AUTHORS - -.MT eu@euandre.org -EuAndreh -.ME -and contributors. - - -.SH BUGS - -.IP \(bu -Report bugs to the -.MT ~euandreh/public\-inbox@lists.sr.ht -mailing list -.ME . -Use the subject "\f(CR[remembering] BUG or TASK: -<description>\fR". -.IP \(bu -Browse bugs -.UR https://euandreh.xyz/remembering/TODOs.html -online -.UE . -.IP \(bu -.UR https://euandreh.xyz/remembering/en/ -Homepage -.UE . -.IP \(bu -.UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bremembering%5D -Comments and discussions -.UE . diff --git a/doc/remembering.en.5.in b/doc/remembering.en.5.in deleted file mode 100644 index 367e72b..0000000 --- a/doc/remembering.en.5.in +++ /dev/null @@ -1,94 +0,0 @@ -.TH REMEMBERING 5 @DATE@ "remembering @VERSION@" - - -.SH NAME - -remembering - format of the \fIPROFILE\fR text file. - - -.SH PROFILE - -The \fIPROFILE\fR is a text file, stored on \f(CR$XDG_DATA_HOME/remembering/profile-name\fR if \f(CR$XDG_DATA_HOME\fR is defined. -Otherwise, it lives in \f(CR~/.local/share/remembering/profile-name\fR. - -Each line of the \fIPROFILE\fR contains three pieces of information: - -.RS -.IP 1 -the \fBrank\fR of the current entry; -.IP 2 -the \f(CR:\fR separator; -.IP 3 -the \fBentry\fR itself. -.RE - -The \fBrank\fR is a number, and the \fBentry\fR is all the text until the end of the line after the \f(CR:\fR separator: - -.RS -.nf -0:an entry -0:banana -0:entry -0:something -0:zzz -.fi -.RE - -Above is an example of a \fIPROFILE\fR file where all the entries have the default \fBrank\fR value: \fB0\fR. - -If the \fICOMMAND\fR runs and chooses \f(CRbanana\fR, the new \fIPROFILE\fR will be: - -.RS -.nf -0:an entry -1:banana -0:entry -0:something -0:zzz -.fi -.RE - -Now the next time the \fICOMMAND\fR runs it will get \f(CRbanana\fR at the beginning of the list, and as new picks happen their weight will increase, and will keep going up in priority. - -The entries of the \fIPROFILE\fR are created and kept sorted. -\fBremembering\fR(1) expects to always find sorted entries in the \fIPROFILE\fR. - -The current raking algorithm increments entries as a simple counter. -Every time an entry is picked, its ranked is incremented in the \fIPROFILE\fR. - - -.SH SEE ALSO - -\fBremembering\fR(1) - - -.SH AUTHORS - -.MT eu@euandre.org -EuAndreh -.ME -and contributors. - - -.SH BUGS - -.IP \(bu -Report bugs to the -.MT ~euandreh/public\-inbox@lists.sr.ht -mailing list -.ME . -Use the subject "\f(CR[remembering] BUG or TASK: -<description>\fR". -.IP \(bu -Browse bugs -.UR https://euandreh.xyz/remembering/TODOs.html -online -.UE . -.IP \(bu -.UR https://euandreh.xyz/remembering/en/ -Homepage -.UE . -.IP \(bu -.UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bremembering%5D -Comments and discussions -.UE . diff --git a/doc/remembering.eo.1.in b/doc/remembering.eo.1.in deleted file mode 100644 index 76b179d..0000000 --- a/doc/remembering.eo.1.in +++ /dev/null @@ -1,231 +0,0 @@ -.\"******************************************************************* -.\" -.\" This file was generated with po4a. Translate the source file. -.\" -.\"******************************************************************* -.TH REMEMBERING 1 @DATE@ "remembering @VERSION@" - - -.SH NAME - -remembering \- sort list from \fISTDIN\fP using past choices as weight. - - -.SH SYNOPSYS - -\fBremembering\fP \fB\-p\fP \fIPROFILE\fP \fB\-c\fP \fICOMMAND\fP - - -.SH DESCRIPTION - -\fBremembering\fP takes a command that chooses an option as its behaviour, such -as \fBfzf\fP(1) or \fBdmenu\fP(1), and \fIremembers\fP what option is chosen, and as -it is used, will put the most used choices at the beginning of the list. - -\fBremembering\fP reads from STDIN and writes to STDOUT. It expects STDIN to -be sorted. - - -.SH OPTIONS - -.TP -\fB\-c\fP \fICOMMAND\fP -The \fICOMMAND\fP to be executed, reading from standard input (STDIN). - -.TP -\fB\-p\fP \fIPROFILE\fP -The name of the \fIPROFILE\fP where to look up and store raking data. - -.TP -\fB\-h\fP, \fB\-\-help\fP -Show short help text. - -.TP -\fB\-V\fP, \fB\-\-version\fP -Show version number. - - -.SH EXAMPLES - -List current directory and feed it to \fBfzf\fP(1) via \fBremembering\fP: - -.RS -.nf -$ ls | remembering \-p fzf\-ls \-c fzf -.fi -.RE - - -Lists all executables available in \fI$PATH\fP, and feed those to \fBdmenu\fP(1) -via \fBremembering\fP, and execute with \fBsh\fP(1) the choice picked: - -.RS -.nf -$ dmenu_path | remembering \-p dmenu\-exe \-c 'dmenu' | sh -.fi -.RE - -.P -Successive invocations will put the frequent choices at the beginning. - -.SS "Simulation of an interactive session" - -Below is a simulation of an interactive session, comparing the usage of -plain \fBfzf\fP(1) against composing it with \fBremembering\fP: - -.RS -.nf -$ mkdir \-p example/ -$ cd example/ -$ touch a b c d e -$ ls -a b c d e -$ ls | fzf -.fi -.RE - -We begin creating a sample directory called "\f(CRexample/\fR", we cd into -it and create 5 empty files: a, b, c, d and e. - -\f(CRls\fR can list the directory for us, in this case in alphabetical -order. - -When we pipe the output of \f(CRls\fR into \fBfzf\fP(1), we are give given its -prompt to pick one option: - -.RS -.nf - e - d - c - b -> a - 5/5 -> -.fi -.RE - -Here \fBfzf\fP(1) lists the items it gets from \fISTDIN\fP in the order that it -was given, and starts at the first one, "a". - -Once we type "d" and press return, the output of \fBfzf\fP(1) is the choice: - -.RS -.nf -$ ls | fzf -d -.fi -.RE - -Now if we run the same command again, we'll be given the same options, in -the same order: - -.RS -.nf -$ ls | fzf - - e - d - c - b -> a - 5/5 -> - -$ ls | fzf -d -.fi -.RE - -\fBfzf\fP(1) is doing what it is told to: making a prompt with the options -given to it from \fISTDIN\fP, in the order it was given. - -In order to have our past choices show up in the beginning of the list, we -can compose \fBfzf\fP(1) with \fBremembering\fP: - -.RS -.nf -$ ls | remembering \-p tutorial\-example \-c 'fzf' - - e - d - c - b -> a - 5/5 -> - -$ ls | remembering \-p tutorial\-example \-c 'fzf' -d -.fi -.RE - -So far we get the exact same behaviour, but saying extra things. We tell -\fBremembering\fP that we want this specific \fIPROFILE\fP to be called -"\f(CRtutorial\-example\fR", and we give \fBremembering\fP the \f(CR'fzf'\fR -command to be ran. - -From now on if we run the exact same command again, \fBremembering\fP will -\fIremember\fP that the last choice was "d", and put it in the beginning of the -list, which \fBfzf\fP(1) happily displays in the order it was given: - -.RS -.nf -$ ls | remembering \-p tutorial\-example \-c 'fzf' - - e - c - b - a -> d - 5/5 -> - -$ ls | remembering \-p tutorial\-example \-c 'fzf' -d -.fi -.RE - -This time the "d" option was already the first one, and we can just press -return to get it as the output value from the command. - -This example used \fBfzf\fP(1) as the \fICOMMAND\fP given to \fBremembering\fP, but -you can give to the \fB\-c\fP option anything that reads from \fISTDIN\fP, picks a -line and writes to \fBSTDOUT\fP. - - -.SH "SEE ALSO" - -\fBremembering\fP(5) - - -.SH AUTHORS - -.MT eu@euandre.org -EuAndreh -.ME -and contributors. - - -.SH BUGS - -.IP \(bu -Report bugs to the -.MT ~euandreh/public\-inbox@lists.sr.ht -mailing list -.ME . -Use the subject "\f(CR[remembering] BUG or TASK: -<description>\fR". -.IP \(bu -Browse bugs -.UR https://euandreh.xyz/remembering/TODOs.html -online -.UE . -.IP \(bu -.UR https://euandreh.xyz/remembering/en/ -Homepage -.UE . -.IP \(bu -.UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bremembering%5D -Comments and discussions -.UE . diff --git a/doc/remembering.eo.5.in b/doc/remembering.eo.5.in deleted file mode 100644 index 3f78c56..0000000 --- a/doc/remembering.eo.5.in +++ /dev/null @@ -1,106 +0,0 @@ -.\"******************************************************************* -.\" -.\" This file was generated with po4a. Translate the source file. -.\" -.\"******************************************************************* -.TH REMEMBERING 5 @DATE@ "remembering @VERSION@" - - -.SH NAME - -remembering \- format of the \fIPROFILE\fP text file. - - -.SH PROFILE - -The \fIPROFILE\fP is a text file, stored on -\f(CR$XDG_DATA_HOME/remembering/profile\-name\fR if \f(CR$XDG_DATA_HOME\fR is -defined. Otherwise, it lives in -\f(CR~/.local/share/remembering/profile\-name\fR. - -Each line of the \fIPROFILE\fP contains three pieces of information: - -.RS -.IP 1 -the \fBrank\fP of the current entry; -.IP 2 -the \f(CR:\fR separator; -.IP 3 -the \fBentry\fP itself. -.RE - -The \fBrank\fP is a number, and the \fBentry\fP is all the text until the end of -the line after the \f(CR:\fR separator: - -.RS -.nf -0:an entry -0:banana -0:entry -0:something -0:zzz -.fi -.RE - -Above is an example of a \fIPROFILE\fP file where all the entries have the -default \fBrank\fP value: \fB0\fP. - -If the \fICOMMAND\fP runs and chooses \f(CRbanana\fR, the new \fIPROFILE\fP will -be: - -.RS -.nf -0:an entry -1:banana -0:entry -0:something -0:zzz -.fi -.RE - -Now the next time the \fICOMMAND\fP runs it will get \f(CRbanana\fR at the -beginning of the list, and as new picks happen their weight will increase, -and will keep going up in priority. - -The entries of the \fIPROFILE\fP are created and kept sorted. -\fBremembering\fP(1) expects to always find sorted entries in the \fIPROFILE\fP. - -The current raking algorithm increments entries as a simple counter. Every -time an entry is picked, its ranked is incremented in the \fIPROFILE\fP. - - -.SH "SEE ALSO" - -\fBremembering\fP(1) - - -.SH AUTHORS - -.MT eu@euandre.org -EuAndreh -.ME -and contributors. - - -.SH BUGS - -.IP \(bu -Report bugs to the -.MT ~euandreh/public\-inbox@lists.sr.ht -mailing list -.ME . -Use the subject "\f(CR[remembering] BUG or TASK: -<description>\fR". -.IP \(bu -Browse bugs -.UR https://euandreh.xyz/remembering/TODOs.html -online -.UE . -.IP \(bu -.UR https://euandreh.xyz/remembering/en/ -Homepage -.UE . -.IP \(bu -.UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bremembering%5D -Comments and discussions -.UE . diff --git a/doc/remembering.es.1.in b/doc/remembering.es.1.in deleted file mode 100644 index 76b179d..0000000 --- a/doc/remembering.es.1.in +++ /dev/null @@ -1,231 +0,0 @@ -.\"******************************************************************* -.\" -.\" This file was generated with po4a. Translate the source file. -.\" -.\"******************************************************************* -.TH REMEMBERING 1 @DATE@ "remembering @VERSION@" - - -.SH NAME - -remembering \- sort list from \fISTDIN\fP using past choices as weight. - - -.SH SYNOPSYS - -\fBremembering\fP \fB\-p\fP \fIPROFILE\fP \fB\-c\fP \fICOMMAND\fP - - -.SH DESCRIPTION - -\fBremembering\fP takes a command that chooses an option as its behaviour, such -as \fBfzf\fP(1) or \fBdmenu\fP(1), and \fIremembers\fP what option is chosen, and as -it is used, will put the most used choices at the beginning of the list. - -\fBremembering\fP reads from STDIN and writes to STDOUT. It expects STDIN to -be sorted. - - -.SH OPTIONS - -.TP -\fB\-c\fP \fICOMMAND\fP -The \fICOMMAND\fP to be executed, reading from standard input (STDIN). - -.TP -\fB\-p\fP \fIPROFILE\fP -The name of the \fIPROFILE\fP where to look up and store raking data. - -.TP -\fB\-h\fP, \fB\-\-help\fP -Show short help text. - -.TP -\fB\-V\fP, \fB\-\-version\fP -Show version number. - - -.SH EXAMPLES - -List current directory and feed it to \fBfzf\fP(1) via \fBremembering\fP: - -.RS -.nf -$ ls | remembering \-p fzf\-ls \-c fzf -.fi -.RE - - -Lists all executables available in \fI$PATH\fP, and feed those to \fBdmenu\fP(1) -via \fBremembering\fP, and execute with \fBsh\fP(1) the choice picked: - -.RS -.nf -$ dmenu_path | remembering \-p dmenu\-exe \-c 'dmenu' | sh -.fi -.RE - -.P -Successive invocations will put the frequent choices at the beginning. - -.SS "Simulation of an interactive session" - -Below is a simulation of an interactive session, comparing the usage of -plain \fBfzf\fP(1) against composing it with \fBremembering\fP: - -.RS -.nf -$ mkdir \-p example/ -$ cd example/ -$ touch a b c d e -$ ls -a b c d e -$ ls | fzf -.fi -.RE - -We begin creating a sample directory called "\f(CRexample/\fR", we cd into -it and create 5 empty files: a, b, c, d and e. - -\f(CRls\fR can list the directory for us, in this case in alphabetical -order. - -When we pipe the output of \f(CRls\fR into \fBfzf\fP(1), we are give given its -prompt to pick one option: - -.RS -.nf - e - d - c - b -> a - 5/5 -> -.fi -.RE - -Here \fBfzf\fP(1) lists the items it gets from \fISTDIN\fP in the order that it -was given, and starts at the first one, "a". - -Once we type "d" and press return, the output of \fBfzf\fP(1) is the choice: - -.RS -.nf -$ ls | fzf -d -.fi -.RE - -Now if we run the same command again, we'll be given the same options, in -the same order: - -.RS -.nf -$ ls | fzf - - e - d - c - b -> a - 5/5 -> - -$ ls | fzf -d -.fi -.RE - -\fBfzf\fP(1) is doing what it is told to: making a prompt with the options -given to it from \fISTDIN\fP, in the order it was given. - -In order to have our past choices show up in the beginning of the list, we -can compose \fBfzf\fP(1) with \fBremembering\fP: - -.RS -.nf -$ ls | remembering \-p tutorial\-example \-c 'fzf' - - e - d - c - b -> a - 5/5 -> - -$ ls | remembering \-p tutorial\-example \-c 'fzf' -d -.fi -.RE - -So far we get the exact same behaviour, but saying extra things. We tell -\fBremembering\fP that we want this specific \fIPROFILE\fP to be called -"\f(CRtutorial\-example\fR", and we give \fBremembering\fP the \f(CR'fzf'\fR -command to be ran. - -From now on if we run the exact same command again, \fBremembering\fP will -\fIremember\fP that the last choice was "d", and put it in the beginning of the -list, which \fBfzf\fP(1) happily displays in the order it was given: - -.RS -.nf -$ ls | remembering \-p tutorial\-example \-c 'fzf' - - e - c - b - a -> d - 5/5 -> - -$ ls | remembering \-p tutorial\-example \-c 'fzf' -d -.fi -.RE - -This time the "d" option was already the first one, and we can just press -return to get it as the output value from the command. - -This example used \fBfzf\fP(1) as the \fICOMMAND\fP given to \fBremembering\fP, but -you can give to the \fB\-c\fP option anything that reads from \fISTDIN\fP, picks a -line and writes to \fBSTDOUT\fP. - - -.SH "SEE ALSO" - -\fBremembering\fP(5) - - -.SH AUTHORS - -.MT eu@euandre.org -EuAndreh -.ME -and contributors. - - -.SH BUGS - -.IP \(bu -Report bugs to the -.MT ~euandreh/public\-inbox@lists.sr.ht -mailing list -.ME . -Use the subject "\f(CR[remembering] BUG or TASK: -<description>\fR". -.IP \(bu -Browse bugs -.UR https://euandreh.xyz/remembering/TODOs.html -online -.UE . -.IP \(bu -.UR https://euandreh.xyz/remembering/en/ -Homepage -.UE . -.IP \(bu -.UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bremembering%5D -Comments and discussions -.UE . diff --git a/doc/remembering.es.5.in b/doc/remembering.es.5.in deleted file mode 100644 index 3f78c56..0000000 --- a/doc/remembering.es.5.in +++ /dev/null @@ -1,106 +0,0 @@ -.\"******************************************************************* -.\" -.\" This file was generated with po4a. Translate the source file. -.\" -.\"******************************************************************* -.TH REMEMBERING 5 @DATE@ "remembering @VERSION@" - - -.SH NAME - -remembering \- format of the \fIPROFILE\fP text file. - - -.SH PROFILE - -The \fIPROFILE\fP is a text file, stored on -\f(CR$XDG_DATA_HOME/remembering/profile\-name\fR if \f(CR$XDG_DATA_HOME\fR is -defined. Otherwise, it lives in -\f(CR~/.local/share/remembering/profile\-name\fR. - -Each line of the \fIPROFILE\fP contains three pieces of information: - -.RS -.IP 1 -the \fBrank\fP of the current entry; -.IP 2 -the \f(CR:\fR separator; -.IP 3 -the \fBentry\fP itself. -.RE - -The \fBrank\fP is a number, and the \fBentry\fP is all the text until the end of -the line after the \f(CR:\fR separator: - -.RS -.nf -0:an entry -0:banana -0:entry -0:something -0:zzz -.fi -.RE - -Above is an example of a \fIPROFILE\fP file where all the entries have the -default \fBrank\fP value: \fB0\fP. - -If the \fICOMMAND\fP runs and chooses \f(CRbanana\fR, the new \fIPROFILE\fP will -be: - -.RS -.nf -0:an entry -1:banana -0:entry -0:something -0:zzz -.fi -.RE - -Now the next time the \fICOMMAND\fP runs it will get \f(CRbanana\fR at the -beginning of the list, and as new picks happen their weight will increase, -and will keep going up in priority. - -The entries of the \fIPROFILE\fP are created and kept sorted. -\fBremembering\fP(1) expects to always find sorted entries in the \fIPROFILE\fP. - -The current raking algorithm increments entries as a simple counter. Every -time an entry is picked, its ranked is incremented in the \fIPROFILE\fP. - - -.SH "SEE ALSO" - -\fBremembering\fP(1) - - -.SH AUTHORS - -.MT eu@euandre.org -EuAndreh -.ME -and contributors. - - -.SH BUGS - -.IP \(bu -Report bugs to the -.MT ~euandreh/public\-inbox@lists.sr.ht -mailing list -.ME . -Use the subject "\f(CR[remembering] BUG or TASK: -<description>\fR". -.IP \(bu -Browse bugs -.UR https://euandreh.xyz/remembering/TODOs.html -online -.UE . -.IP \(bu -.UR https://euandreh.xyz/remembering/en/ -Homepage -.UE . -.IP \(bu -.UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bremembering%5D -Comments and discussions -.UE . diff --git a/doc/remembering.fr.1.in b/doc/remembering.fr.1.in deleted file mode 100644 index 76b179d..0000000 --- a/doc/remembering.fr.1.in +++ /dev/null @@ -1,231 +0,0 @@ -.\"******************************************************************* -.\" -.\" This file was generated with po4a. Translate the source file. -.\" -.\"******************************************************************* -.TH REMEMBERING 1 @DATE@ "remembering @VERSION@" - - -.SH NAME - -remembering \- sort list from \fISTDIN\fP using past choices as weight. - - -.SH SYNOPSYS - -\fBremembering\fP \fB\-p\fP \fIPROFILE\fP \fB\-c\fP \fICOMMAND\fP - - -.SH DESCRIPTION - -\fBremembering\fP takes a command that chooses an option as its behaviour, such -as \fBfzf\fP(1) or \fBdmenu\fP(1), and \fIremembers\fP what option is chosen, and as -it is used, will put the most used choices at the beginning of the list. - -\fBremembering\fP reads from STDIN and writes to STDOUT. It expects STDIN to -be sorted. - - -.SH OPTIONS - -.TP -\fB\-c\fP \fICOMMAND\fP -The \fICOMMAND\fP to be executed, reading from standard input (STDIN). - -.TP -\fB\-p\fP \fIPROFILE\fP -The name of the \fIPROFILE\fP where to look up and store raking data. - -.TP -\fB\-h\fP, \fB\-\-help\fP -Show short help text. - -.TP -\fB\-V\fP, \fB\-\-version\fP -Show version number. - - -.SH EXAMPLES - -List current directory and feed it to \fBfzf\fP(1) via \fBremembering\fP: - -.RS -.nf -$ ls | remembering \-p fzf\-ls \-c fzf -.fi -.RE - - -Lists all executables available in \fI$PATH\fP, and feed those to \fBdmenu\fP(1) -via \fBremembering\fP, and execute with \fBsh\fP(1) the choice picked: - -.RS -.nf -$ dmenu_path | remembering \-p dmenu\-exe \-c 'dmenu' | sh -.fi -.RE - -.P -Successive invocations will put the frequent choices at the beginning. - -.SS "Simulation of an interactive session" - -Below is a simulation of an interactive session, comparing the usage of -plain \fBfzf\fP(1) against composing it with \fBremembering\fP: - -.RS -.nf -$ mkdir \-p example/ -$ cd example/ -$ touch a b c d e -$ ls -a b c d e -$ ls | fzf -.fi -.RE - -We begin creating a sample directory called "\f(CRexample/\fR", we cd into -it and create 5 empty files: a, b, c, d and e. - -\f(CRls\fR can list the directory for us, in this case in alphabetical -order. - -When we pipe the output of \f(CRls\fR into \fBfzf\fP(1), we are give given its -prompt to pick one option: - -.RS -.nf - e - d - c - b -> a - 5/5 -> -.fi -.RE - -Here \fBfzf\fP(1) lists the items it gets from \fISTDIN\fP in the order that it -was given, and starts at the first one, "a". - -Once we type "d" and press return, the output of \fBfzf\fP(1) is the choice: - -.RS -.nf -$ ls | fzf -d -.fi -.RE - -Now if we run the same command again, we'll be given the same options, in -the same order: - -.RS -.nf -$ ls | fzf - - e - d - c - b -> a - 5/5 -> - -$ ls | fzf -d -.fi -.RE - -\fBfzf\fP(1) is doing what it is told to: making a prompt with the options -given to it from \fISTDIN\fP, in the order it was given. - -In order to have our past choices show up in the beginning of the list, we -can compose \fBfzf\fP(1) with \fBremembering\fP: - -.RS -.nf -$ ls | remembering \-p tutorial\-example \-c 'fzf' - - e - d - c - b -> a - 5/5 -> - -$ ls | remembering \-p tutorial\-example \-c 'fzf' -d -.fi -.RE - -So far we get the exact same behaviour, but saying extra things. We tell -\fBremembering\fP that we want this specific \fIPROFILE\fP to be called -"\f(CRtutorial\-example\fR", and we give \fBremembering\fP the \f(CR'fzf'\fR -command to be ran. - -From now on if we run the exact same command again, \fBremembering\fP will -\fIremember\fP that the last choice was "d", and put it in the beginning of the -list, which \fBfzf\fP(1) happily displays in the order it was given: - -.RS -.nf -$ ls | remembering \-p tutorial\-example \-c 'fzf' - - e - c - b - a -> d - 5/5 -> - -$ ls | remembering \-p tutorial\-example \-c 'fzf' -d -.fi -.RE - -This time the "d" option was already the first one, and we can just press -return to get it as the output value from the command. - -This example used \fBfzf\fP(1) as the \fICOMMAND\fP given to \fBremembering\fP, but -you can give to the \fB\-c\fP option anything that reads from \fISTDIN\fP, picks a -line and writes to \fBSTDOUT\fP. - - -.SH "SEE ALSO" - -\fBremembering\fP(5) - - -.SH AUTHORS - -.MT eu@euandre.org -EuAndreh -.ME -and contributors. - - -.SH BUGS - -.IP \(bu -Report bugs to the -.MT ~euandreh/public\-inbox@lists.sr.ht -mailing list -.ME . -Use the subject "\f(CR[remembering] BUG or TASK: -<description>\fR". -.IP \(bu -Browse bugs -.UR https://euandreh.xyz/remembering/TODOs.html -online -.UE . -.IP \(bu -.UR https://euandreh.xyz/remembering/en/ -Homepage -.UE . -.IP \(bu -.UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bremembering%5D -Comments and discussions -.UE . diff --git a/doc/remembering.fr.5.in b/doc/remembering.fr.5.in deleted file mode 100644 index 3f78c56..0000000 --- a/doc/remembering.fr.5.in +++ /dev/null @@ -1,106 +0,0 @@ -.\"******************************************************************* -.\" -.\" This file was generated with po4a. Translate the source file. -.\" -.\"******************************************************************* -.TH REMEMBERING 5 @DATE@ "remembering @VERSION@" - - -.SH NAME - -remembering \- format of the \fIPROFILE\fP text file. - - -.SH PROFILE - -The \fIPROFILE\fP is a text file, stored on -\f(CR$XDG_DATA_HOME/remembering/profile\-name\fR if \f(CR$XDG_DATA_HOME\fR is -defined. Otherwise, it lives in -\f(CR~/.local/share/remembering/profile\-name\fR. - -Each line of the \fIPROFILE\fP contains three pieces of information: - -.RS -.IP 1 -the \fBrank\fP of the current entry; -.IP 2 -the \f(CR:\fR separator; -.IP 3 -the \fBentry\fP itself. -.RE - -The \fBrank\fP is a number, and the \fBentry\fP is all the text until the end of -the line after the \f(CR:\fR separator: - -.RS -.nf -0:an entry -0:banana -0:entry -0:something -0:zzz -.fi -.RE - -Above is an example of a \fIPROFILE\fP file where all the entries have the -default \fBrank\fP value: \fB0\fP. - -If the \fICOMMAND\fP runs and chooses \f(CRbanana\fR, the new \fIPROFILE\fP will -be: - -.RS -.nf -0:an entry -1:banana -0:entry -0:something -0:zzz -.fi -.RE - -Now the next time the \fICOMMAND\fP runs it will get \f(CRbanana\fR at the -beginning of the list, and as new picks happen their weight will increase, -and will keep going up in priority. - -The entries of the \fIPROFILE\fP are created and kept sorted. -\fBremembering\fP(1) expects to always find sorted entries in the \fIPROFILE\fP. - -The current raking algorithm increments entries as a simple counter. Every -time an entry is picked, its ranked is incremented in the \fIPROFILE\fP. - - -.SH "SEE ALSO" - -\fBremembering\fP(1) - - -.SH AUTHORS - -.MT eu@euandre.org -EuAndreh -.ME -and contributors. - - -.SH BUGS - -.IP \(bu -Report bugs to the -.MT ~euandreh/public\-inbox@lists.sr.ht -mailing list -.ME . -Use the subject "\f(CR[remembering] BUG or TASK: -<description>\fR". -.IP \(bu -Browse bugs -.UR https://euandreh.xyz/remembering/TODOs.html -online -.UE . -.IP \(bu -.UR https://euandreh.xyz/remembering/en/ -Homepage -.UE . -.IP \(bu -.UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bremembering%5D -Comments and discussions -.UE . diff --git a/doc/remembering.pt.1.in b/doc/remembering.pt.1.in deleted file mode 100644 index 76b179d..0000000 --- a/doc/remembering.pt.1.in +++ /dev/null @@ -1,231 +0,0 @@ -.\"******************************************************************* -.\" -.\" This file was generated with po4a. Translate the source file. -.\" -.\"******************************************************************* -.TH REMEMBERING 1 @DATE@ "remembering @VERSION@" - - -.SH NAME - -remembering \- sort list from \fISTDIN\fP using past choices as weight. - - -.SH SYNOPSYS - -\fBremembering\fP \fB\-p\fP \fIPROFILE\fP \fB\-c\fP \fICOMMAND\fP - - -.SH DESCRIPTION - -\fBremembering\fP takes a command that chooses an option as its behaviour, such -as \fBfzf\fP(1) or \fBdmenu\fP(1), and \fIremembers\fP what option is chosen, and as -it is used, will put the most used choices at the beginning of the list. - -\fBremembering\fP reads from STDIN and writes to STDOUT. It expects STDIN to -be sorted. - - -.SH OPTIONS - -.TP -\fB\-c\fP \fICOMMAND\fP -The \fICOMMAND\fP to be executed, reading from standard input (STDIN). - -.TP -\fB\-p\fP \fIPROFILE\fP -The name of the \fIPROFILE\fP where to look up and store raking data. - -.TP -\fB\-h\fP, \fB\-\-help\fP -Show short help text. - -.TP -\fB\-V\fP, \fB\-\-version\fP -Show version number. - - -.SH EXAMPLES - -List current directory and feed it to \fBfzf\fP(1) via \fBremembering\fP: - -.RS -.nf -$ ls | remembering \-p fzf\-ls \-c fzf -.fi -.RE - - -Lists all executables available in \fI$PATH\fP, and feed those to \fBdmenu\fP(1) -via \fBremembering\fP, and execute with \fBsh\fP(1) the choice picked: - -.RS -.nf -$ dmenu_path | remembering \-p dmenu\-exe \-c 'dmenu' | sh -.fi -.RE - -.P -Successive invocations will put the frequent choices at the beginning. - -.SS "Simulation of an interactive session" - -Below is a simulation of an interactive session, comparing the usage of -plain \fBfzf\fP(1) against composing it with \fBremembering\fP: - -.RS -.nf -$ mkdir \-p example/ -$ cd example/ -$ touch a b c d e -$ ls -a b c d e -$ ls | fzf -.fi -.RE - -We begin creating a sample directory called "\f(CRexample/\fR", we cd into -it and create 5 empty files: a, b, c, d and e. - -\f(CRls\fR can list the directory for us, in this case in alphabetical -order. - -When we pipe the output of \f(CRls\fR into \fBfzf\fP(1), we are give given its -prompt to pick one option: - -.RS -.nf - e - d - c - b -> a - 5/5 -> -.fi -.RE - -Here \fBfzf\fP(1) lists the items it gets from \fISTDIN\fP in the order that it -was given, and starts at the first one, "a". - -Once we type "d" and press return, the output of \fBfzf\fP(1) is the choice: - -.RS -.nf -$ ls | fzf -d -.fi -.RE - -Now if we run the same command again, we'll be given the same options, in -the same order: - -.RS -.nf -$ ls | fzf - - e - d - c - b -> a - 5/5 -> - -$ ls | fzf -d -.fi -.RE - -\fBfzf\fP(1) is doing what it is told to: making a prompt with the options -given to it from \fISTDIN\fP, in the order it was given. - -In order to have our past choices show up in the beginning of the list, we -can compose \fBfzf\fP(1) with \fBremembering\fP: - -.RS -.nf -$ ls | remembering \-p tutorial\-example \-c 'fzf' - - e - d - c - b -> a - 5/5 -> - -$ ls | remembering \-p tutorial\-example \-c 'fzf' -d -.fi -.RE - -So far we get the exact same behaviour, but saying extra things. We tell -\fBremembering\fP that we want this specific \fIPROFILE\fP to be called -"\f(CRtutorial\-example\fR", and we give \fBremembering\fP the \f(CR'fzf'\fR -command to be ran. - -From now on if we run the exact same command again, \fBremembering\fP will -\fIremember\fP that the last choice was "d", and put it in the beginning of the -list, which \fBfzf\fP(1) happily displays in the order it was given: - -.RS -.nf -$ ls | remembering \-p tutorial\-example \-c 'fzf' - - e - c - b - a -> d - 5/5 -> - -$ ls | remembering \-p tutorial\-example \-c 'fzf' -d -.fi -.RE - -This time the "d" option was already the first one, and we can just press -return to get it as the output value from the command. - -This example used \fBfzf\fP(1) as the \fICOMMAND\fP given to \fBremembering\fP, but -you can give to the \fB\-c\fP option anything that reads from \fISTDIN\fP, picks a -line and writes to \fBSTDOUT\fP. - - -.SH "SEE ALSO" - -\fBremembering\fP(5) - - -.SH AUTHORS - -.MT eu@euandre.org -EuAndreh -.ME -and contributors. - - -.SH BUGS - -.IP \(bu -Report bugs to the -.MT ~euandreh/public\-inbox@lists.sr.ht -mailing list -.ME . -Use the subject "\f(CR[remembering] BUG or TASK: -<description>\fR". -.IP \(bu -Browse bugs -.UR https://euandreh.xyz/remembering/TODOs.html -online -.UE . -.IP \(bu -.UR https://euandreh.xyz/remembering/en/ -Homepage -.UE . -.IP \(bu -.UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bremembering%5D -Comments and discussions -.UE . diff --git a/doc/remembering.pt.5.in b/doc/remembering.pt.5.in deleted file mode 100644 index 3f78c56..0000000 --- a/doc/remembering.pt.5.in +++ /dev/null @@ -1,106 +0,0 @@ -.\"******************************************************************* -.\" -.\" This file was generated with po4a. Translate the source file. -.\" -.\"******************************************************************* -.TH REMEMBERING 5 @DATE@ "remembering @VERSION@" - - -.SH NAME - -remembering \- format of the \fIPROFILE\fP text file. - - -.SH PROFILE - -The \fIPROFILE\fP is a text file, stored on -\f(CR$XDG_DATA_HOME/remembering/profile\-name\fR if \f(CR$XDG_DATA_HOME\fR is -defined. Otherwise, it lives in -\f(CR~/.local/share/remembering/profile\-name\fR. - -Each line of the \fIPROFILE\fP contains three pieces of information: - -.RS -.IP 1 -the \fBrank\fP of the current entry; -.IP 2 -the \f(CR:\fR separator; -.IP 3 -the \fBentry\fP itself. -.RE - -The \fBrank\fP is a number, and the \fBentry\fP is all the text until the end of -the line after the \f(CR:\fR separator: - -.RS -.nf -0:an entry -0:banana -0:entry -0:something -0:zzz -.fi -.RE - -Above is an example of a \fIPROFILE\fP file where all the entries have the -default \fBrank\fP value: \fB0\fP. - -If the \fICOMMAND\fP runs and chooses \f(CRbanana\fR, the new \fIPROFILE\fP will -be: - -.RS -.nf -0:an entry -1:banana -0:entry -0:something -0:zzz -.fi -.RE - -Now the next time the \fICOMMAND\fP runs it will get \f(CRbanana\fR at the -beginning of the list, and as new picks happen their weight will increase, -and will keep going up in priority. - -The entries of the \fIPROFILE\fP are created and kept sorted. -\fBremembering\fP(1) expects to always find sorted entries in the \fIPROFILE\fP. - -The current raking algorithm increments entries as a simple counter. Every -time an entry is picked, its ranked is incremented in the \fIPROFILE\fP. - - -.SH "SEE ALSO" - -\fBremembering\fP(1) - - -.SH AUTHORS - -.MT eu@euandre.org -EuAndreh -.ME -and contributors. - - -.SH BUGS - -.IP \(bu -Report bugs to the -.MT ~euandreh/public\-inbox@lists.sr.ht -mailing list -.ME . -Use the subject "\f(CR[remembering] BUG or TASK: -<description>\fR". -.IP \(bu -Browse bugs -.UR https://euandreh.xyz/remembering/TODOs.html -online -.UE . -.IP \(bu -.UR https://euandreh.xyz/remembering/en/ -Homepage -.UE . -.IP \(bu -.UR https://lists.sr.ht/~euandreh/public\-inbox?search=%5Bremembering%5D -Comments and discussions -.UE . diff --git a/doc/remembering.recipes.en.7.in b/doc/remembering.recipes.en.7.in deleted file mode 100644 index e69de29..0000000 --- a/doc/remembering.recipes.en.7.in +++ /dev/null diff --git a/doc/remembering.recipes.eo.7.in b/doc/remembering.recipes.eo.7.in deleted file mode 100644 index e69de29..0000000 --- a/doc/remembering.recipes.eo.7.in +++ /dev/null diff --git a/doc/remembering.recipes.es.7.in b/doc/remembering.recipes.es.7.in deleted file mode 100644 index e69de29..0000000 --- a/doc/remembering.recipes.es.7.in +++ /dev/null diff --git a/doc/remembering.recipes.fr.7.in b/doc/remembering.recipes.fr.7.in deleted file mode 100644 index e69de29..0000000 --- a/doc/remembering.recipes.fr.7.in +++ /dev/null diff --git a/doc/remembering.recipes.pt.7.in b/doc/remembering.recipes.pt.7.in deleted file mode 100644 index e69de29..0000000 --- a/doc/remembering.recipes.pt.7.in +++ /dev/null diff --git a/doc/remembering.tutorial.en.7.in b/doc/remembering.tutorial.en.7.in deleted file mode 100644 index e69de29..0000000 --- a/doc/remembering.tutorial.en.7.in +++ /dev/null diff --git a/doc/remembering.tutorial.eo.7.in b/doc/remembering.tutorial.eo.7.in deleted file mode 100644 index e69de29..0000000 --- a/doc/remembering.tutorial.eo.7.in +++ /dev/null diff --git a/doc/remembering.tutorial.es.7.in b/doc/remembering.tutorial.es.7.in deleted file mode 100644 index e69de29..0000000 --- a/doc/remembering.tutorial.es.7.in +++ /dev/null diff --git a/doc/remembering.tutorial.fr.7.in b/doc/remembering.tutorial.fr.7.in deleted file mode 100644 index e69de29..0000000 --- a/doc/remembering.tutorial.fr.7.in +++ /dev/null diff --git a/doc/remembering.tutorial.pt.7.in b/doc/remembering.tutorial.pt.7.in deleted file mode 100644 index e69de29..0000000 --- a/doc/remembering.tutorial.pt.7.in +++ /dev/null diff --git a/doc/remembering.why.en.7.in b/doc/remembering.why.en.7.in deleted file mode 100644 index e69de29..0000000 --- a/doc/remembering.why.en.7.in +++ /dev/null diff --git a/doc/remembering.why.eo.7.in b/doc/remembering.why.eo.7.in deleted file mode 100644 index e69de29..0000000 --- a/doc/remembering.why.eo.7.in +++ /dev/null diff --git a/doc/remembering.why.es.7.in b/doc/remembering.why.es.7.in deleted file mode 100644 index e69de29..0000000 --- a/doc/remembering.why.es.7.in +++ /dev/null diff --git a/doc/remembering.why.fr.7.in b/doc/remembering.why.fr.7.in deleted file mode 100644 index e69de29..0000000 --- a/doc/remembering.why.fr.7.in +++ /dev/null diff --git a/doc/remembering.why.pt.7.in b/doc/remembering.why.pt.7.in deleted file mode 100644 index e69de29..0000000 --- a/doc/remembering.why.pt.7.in +++ /dev/null diff --git a/long-description b/long-description deleted file mode 100644 index 4cba359..0000000 --- a/long-description +++ /dev/null @@ -1,2 +0,0 @@ -It can wrap such tools to accumulate preferences over time, and -re-arrange the input according to common picks. diff --git a/manifest.scm b/manifest.scm deleted file mode 100644 index a537d79..0000000 --- a/manifest.scm +++ /dev/null @@ -1,25 +0,0 @@ -(specifications->manifest - (map - symbol->string - '(bash - coreutils - findutils - diffutils - grep - sed - git - gawk - make - makefile2graph - graphviz - pandoc - shellcheck - gettext - po4a - mdpo - hunspell - hunspell-dict-en-utf8 - hunspell-dict-pt-utf8 - hunspell-dict-fr-utf8 - hunspell-dict-eo-utf8 - hunspell-dict-es-utf8))) diff --git a/mkdeps.sh b/mkdeps.sh new file mode 100644 index 0000000..d7d2f06 --- /dev/null +++ b/mkdeps.sh @@ -0,0 +1,32 @@ +#!/bin/sh +set -eu + +export LANG=POSIX.UTF-8 + + +libs() { + find src tests -name '*.go' | + grep -Ev '/(main|meta)\.go$' +} + +mains() { + find src tests -name '*.go' | grep '/main\.go$' +} + + +libs | varlist 'libs.go' +mains | varlist 'mains.go' + +find doc -name '*.adoc' | varlist 'manpages.adoc' + +find tests/functional/*/*.go -not -name main.go | varlist 'functional/lib.go' +find tests/functional/*/main.go | varlist 'functional/main.go' +find tests/fuzz/*/*.go -not -name main.go | varlist 'fuzz/lib.go' +find tests/fuzz/*/main.go | varlist 'fuzz/main.go' +find tests/benchmarks/*/*.go -not -name main.go | varlist 'benchmarks/lib.go' +find tests/benchmarks/*/main.go | varlist 'benchmarks/main.go' + +{ libs; mains; } | sort | sed 's/^\(.*\)\.go$/\1.a:\t\1.go/' +mains | sort | sed 's/^\(.*\)\.go$/\1.bin:\t\1.a/' +mains | sort | sed 's/^\(.*\)\.go$/\1.bin-check:\t\1.bin/' +mains | sort | sed 's|^\(.*\)/main\.go$|\1/main.a:\t\1/$(NAME).a|' diff --git a/po/eo.po b/po/eo.po deleted file mode 100644 index 84026f0..0000000 --- a/po/eo.po +++ /dev/null @@ -1,1066 +0,0 @@ -#. type: TH -#: doc/remembering.en.1.in:1 doc/remembering.en.5.in:1 -#, no-wrap -msgid "REMEMBERING" -msgstr "" - -#. type: TH -#: doc/remembering.en.1.in:1 doc/remembering.en.5.in:1 -#, no-wrap -msgid "@DATE@" -msgstr "" - -#. type: TH -#: doc/remembering.en.1.in:1 doc/remembering.en.5.in:1 -#, no-wrap -msgid "remembering @VERSION@" -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:4 doc/remembering.en.5.in:4 -#, no-wrap -msgid "NAME" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:7 -msgid "remembering - sort list from I<STDIN> using past choices as weight." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:9 -#, no-wrap -msgid "SYNOPSYS" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:12 -msgid "B<remembering> B<-p> I<PROFILE> B<-c> I<COMMAND>" -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:14 -#, no-wrap -msgid "DESCRIPTION" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:17 -msgid "" -"B<remembering> takes a command that chooses an option as its behaviour, such " -"as B<fzf>(1) or B<dmenu>(1), and I<remembers> what option is chosen, and as " -"it is used, will put the most used choices at the beginning of the list." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:20 -msgid "" -"B<remembering> reads from STDIN and writes to STDOUT. It expects STDIN to " -"be sorted." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:22 -#, no-wrap -msgid "OPTIONS" -msgstr "" - -#. type: TP -#: doc/remembering.en.1.in:24 -#, no-wrap -msgid "B<-c> I<COMMAND>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:27 -msgid "The I<COMMAND> to be executed, reading from standard input (STDIN)." -msgstr "" - -#. type: TP -#: doc/remembering.en.1.in:28 -#, no-wrap -msgid "B<-p> I<PROFILE>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:31 -msgid "The name of the I<PROFILE> where to look up and store raking data." -msgstr "" - -#. type: TP -#: doc/remembering.en.1.in:32 -#, no-wrap -msgid "B<-h>, B<--help>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:35 -msgid "Show short help text." -msgstr "" - -#. type: TP -#: doc/remembering.en.1.in:36 -#, no-wrap -msgid "B<-V>, B<--version>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:39 -msgid "Show version number." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:41 -#, no-wrap -msgid "EXAMPLES" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:44 -msgid "List current directory and feed it to B<fzf>(1) via B<remembering>:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:48 -#, no-wrap -msgid "$ ls | remembering -p fzf-ls -c fzf\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:53 -msgid "" -"Lists all executables available in I<$PATH>, and feed those to B<dmenu>(1) " -"via B<remembering>, and execute with B<sh>(1) the choice picked:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:57 -#, no-wrap -msgid "$ dmenu_path | remembering -p dmenu-exe -c 'dmenu' | sh\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:62 -msgid "Successive invocations will put the frequent choices at the beginning." -msgstr "" - -#. type: SS -#: doc/remembering.en.1.in:63 -#, no-wrap -msgid "Simulation of an interactive session" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:66 -msgid "" -"Below is a simulation of an interactive session, comparing the usage of " -"plain B<fzf>(1) against composing it with B<remembering>:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:75 -#, no-wrap -msgid "" -"$ mkdir -p example/\n" -"$ cd example/\n" -"$ touch a b c d e\n" -"$ ls\n" -"a b c d e\n" -"$ ls | fzf\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:79 -msgid "" -"We begin creating a sample directory called \"\\f(CRexample/\\fR\", we cd " -"into it and create 5 empty files: a, b, c, d and e." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:81 -msgid "" -"\\f(CRls\\fR can list the directory for us, in this case in alphabetical " -"order." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:83 -msgid "" -"When we pipe the output of \\f(CRls\\fR into B<fzf>(1), we are give given " -"its prompt to pick one option:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:93 doc/remembering.en.1.in:120 -#: doc/remembering.en.1.in:141 -#, no-wrap -msgid "" -" e\n" -" d\n" -" c\n" -" b\n" -"E<gt> a\n" -" 5/5\n" -"E<gt>\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:97 -msgid "" -"Here B<fzf>(1) lists the items it gets from I<STDIN> in the order that it " -"was given, and starts at the first one, \"a\"." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:99 -msgid "" -"Once we type \"d\" and press return, the output of B<fzf>(1) is the choice:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:104 doc/remembering.en.1.in:123 -#, no-wrap -msgid "" -"$ ls | fzf\n" -"d\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:108 -msgid "" -"Now if we run the same command again, we'll be given the same options, in " -"the same order:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:112 -#, no-wrap -msgid "$ ls | fzf\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:127 -msgid "" -"B<fzf>(1) is doing what it is told to: making a prompt with the options " -"given to it from I<STDIN>, in the order it was given." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:129 -msgid "" -"In order to have our past choices show up in the beginning of the list, we " -"can compose B<fzf>(1) with B<remembering>:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:133 doc/remembering.en.1.in:155 -#, no-wrap -msgid "$ ls | remembering -p tutorial-example -c 'fzf'\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:144 doc/remembering.en.1.in:166 -#, no-wrap -msgid "" -"$ ls | remembering -p tutorial-example -c 'fzf'\n" -"d\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:149 -msgid "" -"So far we get the exact same behaviour, but saying extra things. We tell " -"B<remembering> that we want this specific I<PROFILE> to be called " -"\"\\f(CRtutorial-example\\fR\", and we give B<remembering> the " -"\\f(CR'fzf'\\fR command to be ran." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:151 -msgid "" -"From now on if we run the exact same command again, B<remembering> will " -"I<remember> that the last choice was \"d\", and put it in the beginning of " -"the list, which B<fzf>(1) happily displays in the order it was given:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:163 -#, no-wrap -msgid "" -" e\n" -" c\n" -" b\n" -" a\n" -"E<gt> d\n" -" 5/5\n" -"E<gt>\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:170 -msgid "" -"This time the \"d\" option was already the first one, and we can just press " -"return to get it as the output value from the command." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:172 -msgid "" -"This example used B<fzf>(1) as the I<COMMAND> given to B<remembering>, but " -"you can give to the B<-c> option anything that reads from I<STDIN>, picks a " -"line and writes to B<STDOUT>." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:174 doc/remembering.en.5.in:60 -#, no-wrap -msgid "SEE ALSO" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:177 -msgid "B<remembering>(5)" -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:179 doc/remembering.en.5.in:65 -#, no-wrap -msgid "AUTHORS" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:185 doc/remembering.en.5.in:71 -msgid "E<.MT eu@euandre.org> EuAndreh E<.ME> and contributors." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:187 doc/remembering.en.5.in:73 -#, no-wrap -msgid "BUGS" -msgstr "" - -#. type: IP -#: doc/remembering.en.1.in:189 doc/remembering.en.1.in:196 -#: doc/remembering.en.1.in:201 doc/remembering.en.1.in:205 -#: doc/remembering.en.5.in:75 doc/remembering.en.5.in:82 -#: doc/remembering.en.5.in:87 doc/remembering.en.5.in:91 -#, no-wrap -msgid "\\(bu" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:196 doc/remembering.en.5.in:82 -msgid "" -"Report bugs to the E<.MT ~euandreh/public-inbox@lists.sr.ht> mailing list E<." -"ME .> Use the subject \"\\f(CR[remembering] BUG or TASK: " -"E<lt>descriptionE<gt>\\fR\"." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:201 doc/remembering.en.5.in:87 -msgid "" -"Browse bugs E<.UR https://euandreh.xyz/remembering/TODOs.html> online E<.UE ." -">" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:205 doc/remembering.en.5.in:91 -msgid "E<.UR https://euandreh.xyz/remembering/en/> Homepage E<.UE .>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:208 doc/remembering.en.5.in:94 -msgid "" -"E<.UR https://lists.sr.ht/~euandreh/public-inbox?search=%5Bremembering%5D> " -"Comments and discussions E<.UE .>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:7 -msgid "remembering - format of the I<PROFILE> text file." -msgstr "" - -#. type: SH -#: doc/remembering.en.5.in:9 -#, no-wrap -msgid "PROFILE" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:13 -msgid "" -"The I<PROFILE> is a text file, stored on \\f(CR$XDG_DATA_HOME/remembering/" -"profile-name\\fR if \\f(CR$XDG_DATA_HOME\\fR is defined. Otherwise, it " -"lives in \\f(CR~/.local/share/remembering/profile-name\\fR." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:15 -msgid "Each line of the I<PROFILE> contains three pieces of information:" -msgstr "" - -#. type: IP -#: doc/remembering.en.5.in:17 -#, no-wrap -msgid "1" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:19 -msgid "the B<rank> of the current entry;" -msgstr "" - -#. type: IP -#: doc/remembering.en.5.in:19 -#, no-wrap -msgid "2" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:21 -msgid "the \\f(CR:\\fR separator;" -msgstr "" - -#. type: IP -#: doc/remembering.en.5.in:21 -#, no-wrap -msgid "3" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:23 -msgid "the B<entry> itself." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:26 -msgid "" -"The B<rank> is a number, and the B<entry> is all the text until the end of " -"the line after the \\f(CR:\\fR separator:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:34 -#, no-wrap -msgid "" -"0:an entry\n" -"0:banana\n" -"0:entry\n" -"0:something\n" -"0:zzz\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:38 -msgid "" -"Above is an example of a I<PROFILE> file where all the entries have the " -"default B<rank> value: B<0>." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:40 -msgid "" -"If the I<COMMAND> runs and chooses \\f(CRbanana\\fR, the new I<PROFILE> will " -"be:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:48 -#, no-wrap -msgid "" -"0:an entry\n" -"1:banana\n" -"0:entry\n" -"0:something\n" -"0:zzz\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:52 -msgid "" -"Now the next time the I<COMMAND> runs it will get \\f(CRbanana\\fR at the " -"beginning of the list, and as new picks happen their weight will increase, " -"and will keep going up in priority." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:55 -msgid "" -"The entries of the I<PROFILE> are created and kept sorted. " -"B<remembering>(1) expects to always find sorted entries in the I<PROFILE>." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:58 -msgid "" -"The current raking algorithm increments entries as a simple counter. Every " -"time an entry is picked, its ranked is incremented in the I<PROFILE>." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:63 -msgid "B<remembering>(1)" -msgstr "" - -#. type: Plain text -#: index.en.md:2 -msgid "# remembering" -msgstr "" - -#. type: Plain text -#: index.en.md:4 -msgid "[pt][pt1] | [fr][fr1] | [eo][eo1]" -msgstr "" - -#. type: Plain text -#: index.en.md:8 -msgid "" -"[pt1]: https://euandreh.xyz/remembering/pt/ [fr1]: https://euandreh.xyz/" -"remembering/fr/ [eo1]: https://euandreh.xyz/remembering/eo/" -msgstr "" - -#. type: Plain text -#: index.en.md:10 -msgid "Add memory to [`dmenu`][dmenu], [`fzf`][fzf] and similar tools." -msgstr "" - -#. type: Plain text -#: index.en.md:13 -msgid "" -"It can wrap such tools to accumulate preferences over time, and re-arrange " -"the input according to common picks." -msgstr "" - -#. type: Plain text -#: index.en.md:16 -msgid "## Usage" -msgstr "" - -#. type: Plain text -#: index.en.md:21 -msgid "Replace: ```shell $ ls | fzf ```" -msgstr "" - -#. type: Plain text -#: index.en.md:26 -msgid "with: ```shell $ ls | remembering -p fzf-sample -c fzf ```" -msgstr "" - -#. type: Plain text -#: index.en.md:28 -msgid "" -"and see your previous choices from `fzf` start to appear at the beginning of " -"the list." -msgstr "" - -#. type: Plain text -#: index.en.md:30 -msgid "" -"Similar to [`yeganesh`][yeganesh], but with no build-time or run-time " -"dependencies, and not coupled with `dmenu`." -msgstr "" - -#. type: Plain text -#: index.en.md:34 -msgid "" -"[dmenu]: https://tools.suckless.org/dmenu/ [fzf]: https://github.com/" -"junegunn/fzf [yeganesh]: http://dmwit.com/yeganesh/" -msgstr "" - -#. type: Plain text -#: index.en.md:37 -msgid "## Installation" -msgstr "" - -#. type: Plain text -#: index.en.md:43 -msgid "```shell $ make $ make check # make install ```" -msgstr "" - -#. type: Plain text -#: index.en.md:45 -msgid "You can pass `PREFIX` or `DESTDIR` to `make`:" -msgstr "" - -#. type: Plain text -#: index.en.md:51 -msgid "```shell $ make $ make check $ make install PREFIX=$HOME/.local ```" -msgstr "" - -#. type: Plain text -#: index.en.md:54 -msgid "" -"There are no dependencies or requirements, only standard tools such as POSIX " -"sed, POSIX make, etc." -msgstr "" - -#. type: Plain text -#: index.en.md:57 -msgid "## Documentation" -msgstr "" - -#. type: Plain text -#: index.en.md:59 -msgid "### Manuals" -msgstr "" - -#. type: Plain text -#: index.en.md:63 -msgid "" -"The documentation is available via installed manpages or online: - " -"[`remembering.1`] ([pt][pt.1], [fr][fr.1], [eo][eo.1]); - [`remembering.5`] " -"([pt][pt.5], [fr][fr.5], [eo][eo.5])." -msgstr "" - -#. type: Plain text -#: index.en.md:72 -msgid "" -"[`remembering.1`]: https://euandreh.xyz/remembering/en/remembering.1.html " -"[pt.1]: https://euandreh.xyz/remembering/pt/remembering.1.html [fr.1]: " -"https://euandreh.xyz/remembering/fr/remembering.1.html [eo.1]: https://" -"euandreh.xyz/remembering/eo/remembering.1.html [`remembering.5`]: https://" -"euandreh.xyz/remembering/en/remembering.5.html [pt.5]: https://euandreh.xyz/" -"remembering/pt/remembering.5.html [fr.5]: https://euandreh.xyz/remembering/" -"fr/remembering.5.html [eo.5]: https://euandreh.xyz/remembering/eo/" -"remembering.5.html" -msgstr "" - -#. type: Plain text -#: index.en.md:74 -msgid "### Directory structure" -msgstr "" - -#. type: Plain text -#: index.en.md:83 -#, no-wrap -msgid "" -"The directory structure of the repository is:\n" -"- `aux/`: personal scripts and helpers I've vendored in to ensure the\n" -" repository is self contained, feel free to ignore it;\n" -"- `doc/`: manpages, with their translated versions;\n" -"- `po/`: gettext `.po` files for the translated languages and hunspell\n" -" dictionaries for spell checking;\n" -"- `src/`: main source code for the project;\n" -"- `tests/`: integration tests for the project.\n" -msgstr "" - -#. type: Plain text -#: index.en.md:86 -msgid "## Contributing" -msgstr "" - -#. type: Plain text -#: index.en.md:93 -msgid "" -"Extra tools used for development are: - [Valgrind] for memory testing; - " -"[ShellCheck] for validating scripts; - [po4a], [mdpo] and [gettext] for i18n " -"and l10n support; - [makefile2graph] and [graphviz] for generating [makefile." -"svg]; - [pandoc] for generating the documentation HTML and website." -msgstr "" - -#. type: Plain text -#: index.en.md:103 -msgid "" -"[Valgrind]: https://valgrind.org [ShellCheck]: https://www.shellcheck.net/ " -"[po4a]: https://po4a.org/index.php.en [gettext]: https://www.gnu.org/" -"software/gettext/ [pandoc]: https://pandoc.org/ [mdpo]: https://mdpo." -"readthedocs.io/en/master/ [makefile2graph]: https://github.com/lindenb/" -"makefile2graph [graphviz]: https://graphviz.org/ [makefile.svg]: https://" -"euandreh.xyz/git-permalink/makefile.svg" -msgstr "" - -#. type: Plain text -#: index.en.md:105 -msgid "For running the extra development-only checks, run:" -msgstr "" - -#. type: Plain text -#: index.en.md:109 -msgid "```shell $ make dev-check ```" -msgstr "" - -#. type: Plain text -#: index.en.md:111 -msgid "and for generating the documentation HTML and website, run:" -msgstr "" - -#. type: Plain text -#: index.en.md:115 -msgid "```shell $ make public ```" -msgstr "" - -#. type: Plain text -#: index.en.md:118 -msgid "" -"Send contributions to the [mailing list] via [`git send-email`](https://git-" -"send-email.io/)." -msgstr "" - -#. type: Plain text -#: index.en.md:121 -msgid "## Links" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[homepage](https://euandre.org/s/remembering/en/)" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[source code](https://euandre.org/git/remembering/)" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[bug tracking](https://euandre.org/s/remembering/TODOs.html)" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[mailing list]" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[CI logs](https://euandre.org/s/remembering/ci/)" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[CHANGELOG](https://euandre.org/s/remembering/en/CHANGELOG.html)" -msgstr "" - -#. type: Plain text -#: index.en.md:130 -msgid "" -"[mailing list]: https://lists.sr.ht/~euandreh/public-inbox?search=" -"%5Bremembering%5D" -msgstr "" - -#. type: Plain text -#: index.en.md:133 -msgid "## Releases" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.3.0](https://euandre.org/git/remembering/commit/?id=v0.3.0) [remembering-" -"v0.3.0.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.3.0.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.3.0.tar.gz.asc)) - 2022-11-25" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.2.1](https://euandre.org/git/remembering/commit/?id=v0.2.1) [remembering-" -"v0.2.1.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.2.1.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.2.1.tar.gz.asc)) - 2021-02-23" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.2.0](https://euandre.org/git/remembering/commit/?id=v0.2.0) [remembering-" -"v0.2.0.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.2.0.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.2.0.tar.gz.asc)) - 2021-02-21" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.1.2](https://euandre.org/git/remembering/commit/?id=v0.1.2) [remembering-" -"v0.1.2.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.1.2.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.1.2.tar.gz.asc)) - 2021-01-26" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.1.1](https://euandre.org/git/remembering/commit/?id=v0.1.1) [remembering-" -"v0.1.1.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.1.1.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.1.1.tar.gz.asc)) - 2021-01-26" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.1.0](https://euandre.org/git/remembering/commit/?id=v0.1.0) [remembering-" -"v0.1.0.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.1.0.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.1.0.tar.gz.asc)) - 2021-01-26" -msgstr "" - -#. type: Plain text -#: index.en.md:143 -msgid "## License" -msgstr "" - -#. type: Plain text -#: index.en.md:147 -msgid "" -"The code is licensed under [GNU Affero General Public License v3.0 or later]" -"[AGPL-3.0-or-later] (AGPL-3.0-or-later)." -msgstr "" - -#. type: Plain text -#: index.en.md:148 -msgid "[AGPL-3.0-or-later]: https://euandre.org/git/remembering/tree/COPYING" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:11 -msgid "" -"<!-- Entry template: --> <!-- # Unreleased ## Added ## Changed ## Deprecated " -"## Removed ## Fixed ## Security -->" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:13 -msgid "Changelog for [remembering](https://euandre.org/remembering/en/)." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:16 -msgid "# Unreleased" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:19 -msgid "" -"# [0.3.0](https://euandre.org/git/remembering/commit/?id=v0.3.0) - 2022-11-25" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:21 CHANGELOG.en.md:99 CHANGELOG.en.md:124 -msgid "## Added" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:23 -msgid "### Inference of profiles" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:25 CHANGELOG.en.md:73 CHANGELOG.en.md:103 -msgid "## Changed" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:27 -msgid "### Remove `-c COMMAND` option" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:31 -msgid "" -"Instead of requiring a `-c COMMAND` option explicitly, instead receive the " -"commands to be ran as the \"rest\" argument to `remembering`, stored in `" -"$@`. The usage changes from:" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:35 -msgid "```shell $ remembering -p a-profile -c 'command $arg1 arg2' ```" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:37 -msgid "to:" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:41 -msgid "```shell $ remembering -p a-profile -- command $arg1 arg2 ```" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:51 -#, no-wrap -msgid "" -"The upsides are:\n" -"1. no need to worry about nested quotes: requiring a `-c COMMAND` option forced\n" -" one to wrap the command and args inside quotes, and the quotation used\n" -" influenced the command to be ran;\n" -"1. one less option to know about: instead of having to remember what is the\n" -" specific letter used for the command, just prefix the command with\n" -" `remembering`;\n" -"1. simpler and more powerful composition: wrapping commands without quoting them\n" -" allows one to use many of such tools in combination:\n" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:55 -msgid "```shell $ time nice -n10 timeout 3 remembering sleep 5 ```" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:57 -#, no-wrap -msgid " The equivalent with `-c COMMAND` would be:\n" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:61 -msgid "" -"```shell $ time -c 'nice -n10 -c \"timeout 3 -c 'remembering -c \"sleep " -"5\"'\"' ```" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:64 -#, no-wrap -msgid "" -" But instead of alternating between single and double quotes, properly quoting\n" -" them at each level.\n" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:66 CHANGELOG.en.md:110 CHANGELOG.en.md:117 -msgid "## Fixed" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:68 -msgid "### Improve speed" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:70 -msgid "Rewrite to make it faster" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:75 -msgid "### Use of `$XDG_DATA_HOME`" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:79 -msgid "" -"When the environment variable `$XDG_DATA_HOME` is defined, remembering now " -"appends a trailing `/remembering` to it instead of start writing files to " -"where the environment variable points to." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:81 -msgid "" -"This is in conformance with the [XDG Base Directory Specification][xdg]." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:83 -msgid "" -"[xdg]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-" -"latest.html" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:85 -msgid "### Exit code" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:87 -msgid "" -"When remembering encounters an unrecognized option, it now exits with 2 " -"instead of ignoring it." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:90 -msgid "" -"# [0.2.1](https://euandre.org/git/remembering/commit/?id=v0.2.1) - 2021-02-23" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:92 -msgid "## Removed" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:94 -msgid "Revert to plain `Makefile` over `./configure` + `Makefile.in`." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:97 -msgid "" -"# [0.2.0](https://euandre.org/git/remembering/commit/?id=v0.2.0) - 2021-02-21" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:101 -msgid "Add trivial `./configure` script." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:105 -msgid "Assume standard input is already sorted for faster processing." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:108 -msgid "" -"# [0.1.2](https://euandre.org/git/remembering/commit/?id=v0.1.2) - 2021-01-26" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:112 -msgid "Replace usage of GNU Coreutils' specific `tac` utility with `sed`." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:115 -msgid "" -"# [0.1.1](https://euandre.org/git/remembering/commit/?id=v0.1.1) - 2021-01-26" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:119 -msgid "Allow names with spaces." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:122 -msgid "" -"# [0.1.0](https://euandre.org/git/remembering/commit/?id=v0.1.0) - 2021-01-26" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:125 -msgid "Initial public release." -msgstr "" - -#. type: Plain text -#: aux/checks/manpages/footer.en.0.in:2 -msgid ".SH AUTHORS" -msgstr "" - -#. type: Plain text -#: aux/checks/manpages/footer.en.0.in:7 -msgid ".MT eu@euandre.org EuAndreh .ME and contributors." -msgstr "" - -#. type: Plain text -#: aux/checks/manpages/footer.en.0.in:10 -msgid ".SH BUGS" -msgstr "" - -#. type: Plain text -#: aux/checks/manpages/footer.en.0.in:30 -msgid "" -".IP \\(bu Report bugs to the .MT ~euandreh/@MAILING_LIST@@lists.sr.ht " -"mailing list .ME . Use the subject \"\\f(CR[@NAME@] BUG or TASK: " -"<description>\\fR\". .IP \\(bu Browse bugs .UR https://@DOMAIN@/@NAME@/TODOs." -"html online .UE . .IP \\(bu .UR https://@DOMAIN@/@NAME@/en/ Homepage .UE . ." -"IP \\(bu .UR https://lists.sr.ht/~euandreh/@MAILING_LIST@?search=%5B@NAME@" -"%5D Comments and discussions .UE ." -msgstr "" diff --git a/po/es.po b/po/es.po deleted file mode 100644 index 84026f0..0000000 --- a/po/es.po +++ /dev/null @@ -1,1066 +0,0 @@ -#. type: TH -#: doc/remembering.en.1.in:1 doc/remembering.en.5.in:1 -#, no-wrap -msgid "REMEMBERING" -msgstr "" - -#. type: TH -#: doc/remembering.en.1.in:1 doc/remembering.en.5.in:1 -#, no-wrap -msgid "@DATE@" -msgstr "" - -#. type: TH -#: doc/remembering.en.1.in:1 doc/remembering.en.5.in:1 -#, no-wrap -msgid "remembering @VERSION@" -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:4 doc/remembering.en.5.in:4 -#, no-wrap -msgid "NAME" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:7 -msgid "remembering - sort list from I<STDIN> using past choices as weight." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:9 -#, no-wrap -msgid "SYNOPSYS" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:12 -msgid "B<remembering> B<-p> I<PROFILE> B<-c> I<COMMAND>" -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:14 -#, no-wrap -msgid "DESCRIPTION" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:17 -msgid "" -"B<remembering> takes a command that chooses an option as its behaviour, such " -"as B<fzf>(1) or B<dmenu>(1), and I<remembers> what option is chosen, and as " -"it is used, will put the most used choices at the beginning of the list." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:20 -msgid "" -"B<remembering> reads from STDIN and writes to STDOUT. It expects STDIN to " -"be sorted." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:22 -#, no-wrap -msgid "OPTIONS" -msgstr "" - -#. type: TP -#: doc/remembering.en.1.in:24 -#, no-wrap -msgid "B<-c> I<COMMAND>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:27 -msgid "The I<COMMAND> to be executed, reading from standard input (STDIN)." -msgstr "" - -#. type: TP -#: doc/remembering.en.1.in:28 -#, no-wrap -msgid "B<-p> I<PROFILE>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:31 -msgid "The name of the I<PROFILE> where to look up and store raking data." -msgstr "" - -#. type: TP -#: doc/remembering.en.1.in:32 -#, no-wrap -msgid "B<-h>, B<--help>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:35 -msgid "Show short help text." -msgstr "" - -#. type: TP -#: doc/remembering.en.1.in:36 -#, no-wrap -msgid "B<-V>, B<--version>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:39 -msgid "Show version number." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:41 -#, no-wrap -msgid "EXAMPLES" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:44 -msgid "List current directory and feed it to B<fzf>(1) via B<remembering>:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:48 -#, no-wrap -msgid "$ ls | remembering -p fzf-ls -c fzf\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:53 -msgid "" -"Lists all executables available in I<$PATH>, and feed those to B<dmenu>(1) " -"via B<remembering>, and execute with B<sh>(1) the choice picked:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:57 -#, no-wrap -msgid "$ dmenu_path | remembering -p dmenu-exe -c 'dmenu' | sh\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:62 -msgid "Successive invocations will put the frequent choices at the beginning." -msgstr "" - -#. type: SS -#: doc/remembering.en.1.in:63 -#, no-wrap -msgid "Simulation of an interactive session" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:66 -msgid "" -"Below is a simulation of an interactive session, comparing the usage of " -"plain B<fzf>(1) against composing it with B<remembering>:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:75 -#, no-wrap -msgid "" -"$ mkdir -p example/\n" -"$ cd example/\n" -"$ touch a b c d e\n" -"$ ls\n" -"a b c d e\n" -"$ ls | fzf\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:79 -msgid "" -"We begin creating a sample directory called \"\\f(CRexample/\\fR\", we cd " -"into it and create 5 empty files: a, b, c, d and e." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:81 -msgid "" -"\\f(CRls\\fR can list the directory for us, in this case in alphabetical " -"order." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:83 -msgid "" -"When we pipe the output of \\f(CRls\\fR into B<fzf>(1), we are give given " -"its prompt to pick one option:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:93 doc/remembering.en.1.in:120 -#: doc/remembering.en.1.in:141 -#, no-wrap -msgid "" -" e\n" -" d\n" -" c\n" -" b\n" -"E<gt> a\n" -" 5/5\n" -"E<gt>\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:97 -msgid "" -"Here B<fzf>(1) lists the items it gets from I<STDIN> in the order that it " -"was given, and starts at the first one, \"a\"." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:99 -msgid "" -"Once we type \"d\" and press return, the output of B<fzf>(1) is the choice:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:104 doc/remembering.en.1.in:123 -#, no-wrap -msgid "" -"$ ls | fzf\n" -"d\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:108 -msgid "" -"Now if we run the same command again, we'll be given the same options, in " -"the same order:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:112 -#, no-wrap -msgid "$ ls | fzf\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:127 -msgid "" -"B<fzf>(1) is doing what it is told to: making a prompt with the options " -"given to it from I<STDIN>, in the order it was given." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:129 -msgid "" -"In order to have our past choices show up in the beginning of the list, we " -"can compose B<fzf>(1) with B<remembering>:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:133 doc/remembering.en.1.in:155 -#, no-wrap -msgid "$ ls | remembering -p tutorial-example -c 'fzf'\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:144 doc/remembering.en.1.in:166 -#, no-wrap -msgid "" -"$ ls | remembering -p tutorial-example -c 'fzf'\n" -"d\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:149 -msgid "" -"So far we get the exact same behaviour, but saying extra things. We tell " -"B<remembering> that we want this specific I<PROFILE> to be called " -"\"\\f(CRtutorial-example\\fR\", and we give B<remembering> the " -"\\f(CR'fzf'\\fR command to be ran." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:151 -msgid "" -"From now on if we run the exact same command again, B<remembering> will " -"I<remember> that the last choice was \"d\", and put it in the beginning of " -"the list, which B<fzf>(1) happily displays in the order it was given:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:163 -#, no-wrap -msgid "" -" e\n" -" c\n" -" b\n" -" a\n" -"E<gt> d\n" -" 5/5\n" -"E<gt>\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:170 -msgid "" -"This time the \"d\" option was already the first one, and we can just press " -"return to get it as the output value from the command." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:172 -msgid "" -"This example used B<fzf>(1) as the I<COMMAND> given to B<remembering>, but " -"you can give to the B<-c> option anything that reads from I<STDIN>, picks a " -"line and writes to B<STDOUT>." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:174 doc/remembering.en.5.in:60 -#, no-wrap -msgid "SEE ALSO" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:177 -msgid "B<remembering>(5)" -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:179 doc/remembering.en.5.in:65 -#, no-wrap -msgid "AUTHORS" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:185 doc/remembering.en.5.in:71 -msgid "E<.MT eu@euandre.org> EuAndreh E<.ME> and contributors." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:187 doc/remembering.en.5.in:73 -#, no-wrap -msgid "BUGS" -msgstr "" - -#. type: IP -#: doc/remembering.en.1.in:189 doc/remembering.en.1.in:196 -#: doc/remembering.en.1.in:201 doc/remembering.en.1.in:205 -#: doc/remembering.en.5.in:75 doc/remembering.en.5.in:82 -#: doc/remembering.en.5.in:87 doc/remembering.en.5.in:91 -#, no-wrap -msgid "\\(bu" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:196 doc/remembering.en.5.in:82 -msgid "" -"Report bugs to the E<.MT ~euandreh/public-inbox@lists.sr.ht> mailing list E<." -"ME .> Use the subject \"\\f(CR[remembering] BUG or TASK: " -"E<lt>descriptionE<gt>\\fR\"." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:201 doc/remembering.en.5.in:87 -msgid "" -"Browse bugs E<.UR https://euandreh.xyz/remembering/TODOs.html> online E<.UE ." -">" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:205 doc/remembering.en.5.in:91 -msgid "E<.UR https://euandreh.xyz/remembering/en/> Homepage E<.UE .>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:208 doc/remembering.en.5.in:94 -msgid "" -"E<.UR https://lists.sr.ht/~euandreh/public-inbox?search=%5Bremembering%5D> " -"Comments and discussions E<.UE .>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:7 -msgid "remembering - format of the I<PROFILE> text file." -msgstr "" - -#. type: SH -#: doc/remembering.en.5.in:9 -#, no-wrap -msgid "PROFILE" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:13 -msgid "" -"The I<PROFILE> is a text file, stored on \\f(CR$XDG_DATA_HOME/remembering/" -"profile-name\\fR if \\f(CR$XDG_DATA_HOME\\fR is defined. Otherwise, it " -"lives in \\f(CR~/.local/share/remembering/profile-name\\fR." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:15 -msgid "Each line of the I<PROFILE> contains three pieces of information:" -msgstr "" - -#. type: IP -#: doc/remembering.en.5.in:17 -#, no-wrap -msgid "1" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:19 -msgid "the B<rank> of the current entry;" -msgstr "" - -#. type: IP -#: doc/remembering.en.5.in:19 -#, no-wrap -msgid "2" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:21 -msgid "the \\f(CR:\\fR separator;" -msgstr "" - -#. type: IP -#: doc/remembering.en.5.in:21 -#, no-wrap -msgid "3" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:23 -msgid "the B<entry> itself." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:26 -msgid "" -"The B<rank> is a number, and the B<entry> is all the text until the end of " -"the line after the \\f(CR:\\fR separator:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:34 -#, no-wrap -msgid "" -"0:an entry\n" -"0:banana\n" -"0:entry\n" -"0:something\n" -"0:zzz\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:38 -msgid "" -"Above is an example of a I<PROFILE> file where all the entries have the " -"default B<rank> value: B<0>." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:40 -msgid "" -"If the I<COMMAND> runs and chooses \\f(CRbanana\\fR, the new I<PROFILE> will " -"be:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:48 -#, no-wrap -msgid "" -"0:an entry\n" -"1:banana\n" -"0:entry\n" -"0:something\n" -"0:zzz\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:52 -msgid "" -"Now the next time the I<COMMAND> runs it will get \\f(CRbanana\\fR at the " -"beginning of the list, and as new picks happen their weight will increase, " -"and will keep going up in priority." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:55 -msgid "" -"The entries of the I<PROFILE> are created and kept sorted. " -"B<remembering>(1) expects to always find sorted entries in the I<PROFILE>." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:58 -msgid "" -"The current raking algorithm increments entries as a simple counter. Every " -"time an entry is picked, its ranked is incremented in the I<PROFILE>." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:63 -msgid "B<remembering>(1)" -msgstr "" - -#. type: Plain text -#: index.en.md:2 -msgid "# remembering" -msgstr "" - -#. type: Plain text -#: index.en.md:4 -msgid "[pt][pt1] | [fr][fr1] | [eo][eo1]" -msgstr "" - -#. type: Plain text -#: index.en.md:8 -msgid "" -"[pt1]: https://euandreh.xyz/remembering/pt/ [fr1]: https://euandreh.xyz/" -"remembering/fr/ [eo1]: https://euandreh.xyz/remembering/eo/" -msgstr "" - -#. type: Plain text -#: index.en.md:10 -msgid "Add memory to [`dmenu`][dmenu], [`fzf`][fzf] and similar tools." -msgstr "" - -#. type: Plain text -#: index.en.md:13 -msgid "" -"It can wrap such tools to accumulate preferences over time, and re-arrange " -"the input according to common picks." -msgstr "" - -#. type: Plain text -#: index.en.md:16 -msgid "## Usage" -msgstr "" - -#. type: Plain text -#: index.en.md:21 -msgid "Replace: ```shell $ ls | fzf ```" -msgstr "" - -#. type: Plain text -#: index.en.md:26 -msgid "with: ```shell $ ls | remembering -p fzf-sample -c fzf ```" -msgstr "" - -#. type: Plain text -#: index.en.md:28 -msgid "" -"and see your previous choices from `fzf` start to appear at the beginning of " -"the list." -msgstr "" - -#. type: Plain text -#: index.en.md:30 -msgid "" -"Similar to [`yeganesh`][yeganesh], but with no build-time or run-time " -"dependencies, and not coupled with `dmenu`." -msgstr "" - -#. type: Plain text -#: index.en.md:34 -msgid "" -"[dmenu]: https://tools.suckless.org/dmenu/ [fzf]: https://github.com/" -"junegunn/fzf [yeganesh]: http://dmwit.com/yeganesh/" -msgstr "" - -#. type: Plain text -#: index.en.md:37 -msgid "## Installation" -msgstr "" - -#. type: Plain text -#: index.en.md:43 -msgid "```shell $ make $ make check # make install ```" -msgstr "" - -#. type: Plain text -#: index.en.md:45 -msgid "You can pass `PREFIX` or `DESTDIR` to `make`:" -msgstr "" - -#. type: Plain text -#: index.en.md:51 -msgid "```shell $ make $ make check $ make install PREFIX=$HOME/.local ```" -msgstr "" - -#. type: Plain text -#: index.en.md:54 -msgid "" -"There are no dependencies or requirements, only standard tools such as POSIX " -"sed, POSIX make, etc." -msgstr "" - -#. type: Plain text -#: index.en.md:57 -msgid "## Documentation" -msgstr "" - -#. type: Plain text -#: index.en.md:59 -msgid "### Manuals" -msgstr "" - -#. type: Plain text -#: index.en.md:63 -msgid "" -"The documentation is available via installed manpages or online: - " -"[`remembering.1`] ([pt][pt.1], [fr][fr.1], [eo][eo.1]); - [`remembering.5`] " -"([pt][pt.5], [fr][fr.5], [eo][eo.5])." -msgstr "" - -#. type: Plain text -#: index.en.md:72 -msgid "" -"[`remembering.1`]: https://euandreh.xyz/remembering/en/remembering.1.html " -"[pt.1]: https://euandreh.xyz/remembering/pt/remembering.1.html [fr.1]: " -"https://euandreh.xyz/remembering/fr/remembering.1.html [eo.1]: https://" -"euandreh.xyz/remembering/eo/remembering.1.html [`remembering.5`]: https://" -"euandreh.xyz/remembering/en/remembering.5.html [pt.5]: https://euandreh.xyz/" -"remembering/pt/remembering.5.html [fr.5]: https://euandreh.xyz/remembering/" -"fr/remembering.5.html [eo.5]: https://euandreh.xyz/remembering/eo/" -"remembering.5.html" -msgstr "" - -#. type: Plain text -#: index.en.md:74 -msgid "### Directory structure" -msgstr "" - -#. type: Plain text -#: index.en.md:83 -#, no-wrap -msgid "" -"The directory structure of the repository is:\n" -"- `aux/`: personal scripts and helpers I've vendored in to ensure the\n" -" repository is self contained, feel free to ignore it;\n" -"- `doc/`: manpages, with their translated versions;\n" -"- `po/`: gettext `.po` files for the translated languages and hunspell\n" -" dictionaries for spell checking;\n" -"- `src/`: main source code for the project;\n" -"- `tests/`: integration tests for the project.\n" -msgstr "" - -#. type: Plain text -#: index.en.md:86 -msgid "## Contributing" -msgstr "" - -#. type: Plain text -#: index.en.md:93 -msgid "" -"Extra tools used for development are: - [Valgrind] for memory testing; - " -"[ShellCheck] for validating scripts; - [po4a], [mdpo] and [gettext] for i18n " -"and l10n support; - [makefile2graph] and [graphviz] for generating [makefile." -"svg]; - [pandoc] for generating the documentation HTML and website." -msgstr "" - -#. type: Plain text -#: index.en.md:103 -msgid "" -"[Valgrind]: https://valgrind.org [ShellCheck]: https://www.shellcheck.net/ " -"[po4a]: https://po4a.org/index.php.en [gettext]: https://www.gnu.org/" -"software/gettext/ [pandoc]: https://pandoc.org/ [mdpo]: https://mdpo." -"readthedocs.io/en/master/ [makefile2graph]: https://github.com/lindenb/" -"makefile2graph [graphviz]: https://graphviz.org/ [makefile.svg]: https://" -"euandreh.xyz/git-permalink/makefile.svg" -msgstr "" - -#. type: Plain text -#: index.en.md:105 -msgid "For running the extra development-only checks, run:" -msgstr "" - -#. type: Plain text -#: index.en.md:109 -msgid "```shell $ make dev-check ```" -msgstr "" - -#. type: Plain text -#: index.en.md:111 -msgid "and for generating the documentation HTML and website, run:" -msgstr "" - -#. type: Plain text -#: index.en.md:115 -msgid "```shell $ make public ```" -msgstr "" - -#. type: Plain text -#: index.en.md:118 -msgid "" -"Send contributions to the [mailing list] via [`git send-email`](https://git-" -"send-email.io/)." -msgstr "" - -#. type: Plain text -#: index.en.md:121 -msgid "## Links" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[homepage](https://euandre.org/s/remembering/en/)" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[source code](https://euandre.org/git/remembering/)" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[bug tracking](https://euandre.org/s/remembering/TODOs.html)" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[mailing list]" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[CI logs](https://euandre.org/s/remembering/ci/)" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[CHANGELOG](https://euandre.org/s/remembering/en/CHANGELOG.html)" -msgstr "" - -#. type: Plain text -#: index.en.md:130 -msgid "" -"[mailing list]: https://lists.sr.ht/~euandreh/public-inbox?search=" -"%5Bremembering%5D" -msgstr "" - -#. type: Plain text -#: index.en.md:133 -msgid "## Releases" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.3.0](https://euandre.org/git/remembering/commit/?id=v0.3.0) [remembering-" -"v0.3.0.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.3.0.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.3.0.tar.gz.asc)) - 2022-11-25" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.2.1](https://euandre.org/git/remembering/commit/?id=v0.2.1) [remembering-" -"v0.2.1.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.2.1.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.2.1.tar.gz.asc)) - 2021-02-23" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.2.0](https://euandre.org/git/remembering/commit/?id=v0.2.0) [remembering-" -"v0.2.0.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.2.0.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.2.0.tar.gz.asc)) - 2021-02-21" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.1.2](https://euandre.org/git/remembering/commit/?id=v0.1.2) [remembering-" -"v0.1.2.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.1.2.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.1.2.tar.gz.asc)) - 2021-01-26" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.1.1](https://euandre.org/git/remembering/commit/?id=v0.1.1) [remembering-" -"v0.1.1.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.1.1.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.1.1.tar.gz.asc)) - 2021-01-26" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.1.0](https://euandre.org/git/remembering/commit/?id=v0.1.0) [remembering-" -"v0.1.0.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.1.0.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.1.0.tar.gz.asc)) - 2021-01-26" -msgstr "" - -#. type: Plain text -#: index.en.md:143 -msgid "## License" -msgstr "" - -#. type: Plain text -#: index.en.md:147 -msgid "" -"The code is licensed under [GNU Affero General Public License v3.0 or later]" -"[AGPL-3.0-or-later] (AGPL-3.0-or-later)." -msgstr "" - -#. type: Plain text -#: index.en.md:148 -msgid "[AGPL-3.0-or-later]: https://euandre.org/git/remembering/tree/COPYING" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:11 -msgid "" -"<!-- Entry template: --> <!-- # Unreleased ## Added ## Changed ## Deprecated " -"## Removed ## Fixed ## Security -->" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:13 -msgid "Changelog for [remembering](https://euandre.org/remembering/en/)." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:16 -msgid "# Unreleased" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:19 -msgid "" -"# [0.3.0](https://euandre.org/git/remembering/commit/?id=v0.3.0) - 2022-11-25" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:21 CHANGELOG.en.md:99 CHANGELOG.en.md:124 -msgid "## Added" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:23 -msgid "### Inference of profiles" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:25 CHANGELOG.en.md:73 CHANGELOG.en.md:103 -msgid "## Changed" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:27 -msgid "### Remove `-c COMMAND` option" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:31 -msgid "" -"Instead of requiring a `-c COMMAND` option explicitly, instead receive the " -"commands to be ran as the \"rest\" argument to `remembering`, stored in `" -"$@`. The usage changes from:" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:35 -msgid "```shell $ remembering -p a-profile -c 'command $arg1 arg2' ```" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:37 -msgid "to:" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:41 -msgid "```shell $ remembering -p a-profile -- command $arg1 arg2 ```" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:51 -#, no-wrap -msgid "" -"The upsides are:\n" -"1. no need to worry about nested quotes: requiring a `-c COMMAND` option forced\n" -" one to wrap the command and args inside quotes, and the quotation used\n" -" influenced the command to be ran;\n" -"1. one less option to know about: instead of having to remember what is the\n" -" specific letter used for the command, just prefix the command with\n" -" `remembering`;\n" -"1. simpler and more powerful composition: wrapping commands without quoting them\n" -" allows one to use many of such tools in combination:\n" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:55 -msgid "```shell $ time nice -n10 timeout 3 remembering sleep 5 ```" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:57 -#, no-wrap -msgid " The equivalent with `-c COMMAND` would be:\n" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:61 -msgid "" -"```shell $ time -c 'nice -n10 -c \"timeout 3 -c 'remembering -c \"sleep " -"5\"'\"' ```" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:64 -#, no-wrap -msgid "" -" But instead of alternating between single and double quotes, properly quoting\n" -" them at each level.\n" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:66 CHANGELOG.en.md:110 CHANGELOG.en.md:117 -msgid "## Fixed" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:68 -msgid "### Improve speed" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:70 -msgid "Rewrite to make it faster" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:75 -msgid "### Use of `$XDG_DATA_HOME`" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:79 -msgid "" -"When the environment variable `$XDG_DATA_HOME` is defined, remembering now " -"appends a trailing `/remembering` to it instead of start writing files to " -"where the environment variable points to." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:81 -msgid "" -"This is in conformance with the [XDG Base Directory Specification][xdg]." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:83 -msgid "" -"[xdg]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-" -"latest.html" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:85 -msgid "### Exit code" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:87 -msgid "" -"When remembering encounters an unrecognized option, it now exits with 2 " -"instead of ignoring it." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:90 -msgid "" -"# [0.2.1](https://euandre.org/git/remembering/commit/?id=v0.2.1) - 2021-02-23" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:92 -msgid "## Removed" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:94 -msgid "Revert to plain `Makefile` over `./configure` + `Makefile.in`." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:97 -msgid "" -"# [0.2.0](https://euandre.org/git/remembering/commit/?id=v0.2.0) - 2021-02-21" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:101 -msgid "Add trivial `./configure` script." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:105 -msgid "Assume standard input is already sorted for faster processing." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:108 -msgid "" -"# [0.1.2](https://euandre.org/git/remembering/commit/?id=v0.1.2) - 2021-01-26" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:112 -msgid "Replace usage of GNU Coreutils' specific `tac` utility with `sed`." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:115 -msgid "" -"# [0.1.1](https://euandre.org/git/remembering/commit/?id=v0.1.1) - 2021-01-26" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:119 -msgid "Allow names with spaces." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:122 -msgid "" -"# [0.1.0](https://euandre.org/git/remembering/commit/?id=v0.1.0) - 2021-01-26" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:125 -msgid "Initial public release." -msgstr "" - -#. type: Plain text -#: aux/checks/manpages/footer.en.0.in:2 -msgid ".SH AUTHORS" -msgstr "" - -#. type: Plain text -#: aux/checks/manpages/footer.en.0.in:7 -msgid ".MT eu@euandre.org EuAndreh .ME and contributors." -msgstr "" - -#. type: Plain text -#: aux/checks/manpages/footer.en.0.in:10 -msgid ".SH BUGS" -msgstr "" - -#. type: Plain text -#: aux/checks/manpages/footer.en.0.in:30 -msgid "" -".IP \\(bu Report bugs to the .MT ~euandreh/@MAILING_LIST@@lists.sr.ht " -"mailing list .ME . Use the subject \"\\f(CR[@NAME@] BUG or TASK: " -"<description>\\fR\". .IP \\(bu Browse bugs .UR https://@DOMAIN@/@NAME@/TODOs." -"html online .UE . .IP \\(bu .UR https://@DOMAIN@/@NAME@/en/ Homepage .UE . ." -"IP \\(bu .UR https://lists.sr.ht/~euandreh/@MAILING_LIST@?search=%5B@NAME@" -"%5D Comments and discussions .UE ." -msgstr "" diff --git a/po/fr.po b/po/fr.po deleted file mode 100644 index 84026f0..0000000 --- a/po/fr.po +++ /dev/null @@ -1,1066 +0,0 @@ -#. type: TH -#: doc/remembering.en.1.in:1 doc/remembering.en.5.in:1 -#, no-wrap -msgid "REMEMBERING" -msgstr "" - -#. type: TH -#: doc/remembering.en.1.in:1 doc/remembering.en.5.in:1 -#, no-wrap -msgid "@DATE@" -msgstr "" - -#. type: TH -#: doc/remembering.en.1.in:1 doc/remembering.en.5.in:1 -#, no-wrap -msgid "remembering @VERSION@" -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:4 doc/remembering.en.5.in:4 -#, no-wrap -msgid "NAME" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:7 -msgid "remembering - sort list from I<STDIN> using past choices as weight." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:9 -#, no-wrap -msgid "SYNOPSYS" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:12 -msgid "B<remembering> B<-p> I<PROFILE> B<-c> I<COMMAND>" -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:14 -#, no-wrap -msgid "DESCRIPTION" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:17 -msgid "" -"B<remembering> takes a command that chooses an option as its behaviour, such " -"as B<fzf>(1) or B<dmenu>(1), and I<remembers> what option is chosen, and as " -"it is used, will put the most used choices at the beginning of the list." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:20 -msgid "" -"B<remembering> reads from STDIN and writes to STDOUT. It expects STDIN to " -"be sorted." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:22 -#, no-wrap -msgid "OPTIONS" -msgstr "" - -#. type: TP -#: doc/remembering.en.1.in:24 -#, no-wrap -msgid "B<-c> I<COMMAND>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:27 -msgid "The I<COMMAND> to be executed, reading from standard input (STDIN)." -msgstr "" - -#. type: TP -#: doc/remembering.en.1.in:28 -#, no-wrap -msgid "B<-p> I<PROFILE>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:31 -msgid "The name of the I<PROFILE> where to look up and store raking data." -msgstr "" - -#. type: TP -#: doc/remembering.en.1.in:32 -#, no-wrap -msgid "B<-h>, B<--help>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:35 -msgid "Show short help text." -msgstr "" - -#. type: TP -#: doc/remembering.en.1.in:36 -#, no-wrap -msgid "B<-V>, B<--version>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:39 -msgid "Show version number." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:41 -#, no-wrap -msgid "EXAMPLES" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:44 -msgid "List current directory and feed it to B<fzf>(1) via B<remembering>:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:48 -#, no-wrap -msgid "$ ls | remembering -p fzf-ls -c fzf\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:53 -msgid "" -"Lists all executables available in I<$PATH>, and feed those to B<dmenu>(1) " -"via B<remembering>, and execute with B<sh>(1) the choice picked:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:57 -#, no-wrap -msgid "$ dmenu_path | remembering -p dmenu-exe -c 'dmenu' | sh\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:62 -msgid "Successive invocations will put the frequent choices at the beginning." -msgstr "" - -#. type: SS -#: doc/remembering.en.1.in:63 -#, no-wrap -msgid "Simulation of an interactive session" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:66 -msgid "" -"Below is a simulation of an interactive session, comparing the usage of " -"plain B<fzf>(1) against composing it with B<remembering>:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:75 -#, no-wrap -msgid "" -"$ mkdir -p example/\n" -"$ cd example/\n" -"$ touch a b c d e\n" -"$ ls\n" -"a b c d e\n" -"$ ls | fzf\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:79 -msgid "" -"We begin creating a sample directory called \"\\f(CRexample/\\fR\", we cd " -"into it and create 5 empty files: a, b, c, d and e." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:81 -msgid "" -"\\f(CRls\\fR can list the directory for us, in this case in alphabetical " -"order." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:83 -msgid "" -"When we pipe the output of \\f(CRls\\fR into B<fzf>(1), we are give given " -"its prompt to pick one option:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:93 doc/remembering.en.1.in:120 -#: doc/remembering.en.1.in:141 -#, no-wrap -msgid "" -" e\n" -" d\n" -" c\n" -" b\n" -"E<gt> a\n" -" 5/5\n" -"E<gt>\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:97 -msgid "" -"Here B<fzf>(1) lists the items it gets from I<STDIN> in the order that it " -"was given, and starts at the first one, \"a\"." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:99 -msgid "" -"Once we type \"d\" and press return, the output of B<fzf>(1) is the choice:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:104 doc/remembering.en.1.in:123 -#, no-wrap -msgid "" -"$ ls | fzf\n" -"d\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:108 -msgid "" -"Now if we run the same command again, we'll be given the same options, in " -"the same order:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:112 -#, no-wrap -msgid "$ ls | fzf\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:127 -msgid "" -"B<fzf>(1) is doing what it is told to: making a prompt with the options " -"given to it from I<STDIN>, in the order it was given." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:129 -msgid "" -"In order to have our past choices show up in the beginning of the list, we " -"can compose B<fzf>(1) with B<remembering>:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:133 doc/remembering.en.1.in:155 -#, no-wrap -msgid "$ ls | remembering -p tutorial-example -c 'fzf'\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:144 doc/remembering.en.1.in:166 -#, no-wrap -msgid "" -"$ ls | remembering -p tutorial-example -c 'fzf'\n" -"d\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:149 -msgid "" -"So far we get the exact same behaviour, but saying extra things. We tell " -"B<remembering> that we want this specific I<PROFILE> to be called " -"\"\\f(CRtutorial-example\\fR\", and we give B<remembering> the " -"\\f(CR'fzf'\\fR command to be ran." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:151 -msgid "" -"From now on if we run the exact same command again, B<remembering> will " -"I<remember> that the last choice was \"d\", and put it in the beginning of " -"the list, which B<fzf>(1) happily displays in the order it was given:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:163 -#, no-wrap -msgid "" -" e\n" -" c\n" -" b\n" -" a\n" -"E<gt> d\n" -" 5/5\n" -"E<gt>\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:170 -msgid "" -"This time the \"d\" option was already the first one, and we can just press " -"return to get it as the output value from the command." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:172 -msgid "" -"This example used B<fzf>(1) as the I<COMMAND> given to B<remembering>, but " -"you can give to the B<-c> option anything that reads from I<STDIN>, picks a " -"line and writes to B<STDOUT>." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:174 doc/remembering.en.5.in:60 -#, no-wrap -msgid "SEE ALSO" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:177 -msgid "B<remembering>(5)" -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:179 doc/remembering.en.5.in:65 -#, no-wrap -msgid "AUTHORS" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:185 doc/remembering.en.5.in:71 -msgid "E<.MT eu@euandre.org> EuAndreh E<.ME> and contributors." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:187 doc/remembering.en.5.in:73 -#, no-wrap -msgid "BUGS" -msgstr "" - -#. type: IP -#: doc/remembering.en.1.in:189 doc/remembering.en.1.in:196 -#: doc/remembering.en.1.in:201 doc/remembering.en.1.in:205 -#: doc/remembering.en.5.in:75 doc/remembering.en.5.in:82 -#: doc/remembering.en.5.in:87 doc/remembering.en.5.in:91 -#, no-wrap -msgid "\\(bu" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:196 doc/remembering.en.5.in:82 -msgid "" -"Report bugs to the E<.MT ~euandreh/public-inbox@lists.sr.ht> mailing list E<." -"ME .> Use the subject \"\\f(CR[remembering] BUG or TASK: " -"E<lt>descriptionE<gt>\\fR\"." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:201 doc/remembering.en.5.in:87 -msgid "" -"Browse bugs E<.UR https://euandreh.xyz/remembering/TODOs.html> online E<.UE ." -">" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:205 doc/remembering.en.5.in:91 -msgid "E<.UR https://euandreh.xyz/remembering/en/> Homepage E<.UE .>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:208 doc/remembering.en.5.in:94 -msgid "" -"E<.UR https://lists.sr.ht/~euandreh/public-inbox?search=%5Bremembering%5D> " -"Comments and discussions E<.UE .>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:7 -msgid "remembering - format of the I<PROFILE> text file." -msgstr "" - -#. type: SH -#: doc/remembering.en.5.in:9 -#, no-wrap -msgid "PROFILE" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:13 -msgid "" -"The I<PROFILE> is a text file, stored on \\f(CR$XDG_DATA_HOME/remembering/" -"profile-name\\fR if \\f(CR$XDG_DATA_HOME\\fR is defined. Otherwise, it " -"lives in \\f(CR~/.local/share/remembering/profile-name\\fR." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:15 -msgid "Each line of the I<PROFILE> contains three pieces of information:" -msgstr "" - -#. type: IP -#: doc/remembering.en.5.in:17 -#, no-wrap -msgid "1" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:19 -msgid "the B<rank> of the current entry;" -msgstr "" - -#. type: IP -#: doc/remembering.en.5.in:19 -#, no-wrap -msgid "2" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:21 -msgid "the \\f(CR:\\fR separator;" -msgstr "" - -#. type: IP -#: doc/remembering.en.5.in:21 -#, no-wrap -msgid "3" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:23 -msgid "the B<entry> itself." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:26 -msgid "" -"The B<rank> is a number, and the B<entry> is all the text until the end of " -"the line after the \\f(CR:\\fR separator:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:34 -#, no-wrap -msgid "" -"0:an entry\n" -"0:banana\n" -"0:entry\n" -"0:something\n" -"0:zzz\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:38 -msgid "" -"Above is an example of a I<PROFILE> file where all the entries have the " -"default B<rank> value: B<0>." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:40 -msgid "" -"If the I<COMMAND> runs and chooses \\f(CRbanana\\fR, the new I<PROFILE> will " -"be:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:48 -#, no-wrap -msgid "" -"0:an entry\n" -"1:banana\n" -"0:entry\n" -"0:something\n" -"0:zzz\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:52 -msgid "" -"Now the next time the I<COMMAND> runs it will get \\f(CRbanana\\fR at the " -"beginning of the list, and as new picks happen their weight will increase, " -"and will keep going up in priority." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:55 -msgid "" -"The entries of the I<PROFILE> are created and kept sorted. " -"B<remembering>(1) expects to always find sorted entries in the I<PROFILE>." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:58 -msgid "" -"The current raking algorithm increments entries as a simple counter. Every " -"time an entry is picked, its ranked is incremented in the I<PROFILE>." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:63 -msgid "B<remembering>(1)" -msgstr "" - -#. type: Plain text -#: index.en.md:2 -msgid "# remembering" -msgstr "" - -#. type: Plain text -#: index.en.md:4 -msgid "[pt][pt1] | [fr][fr1] | [eo][eo1]" -msgstr "" - -#. type: Plain text -#: index.en.md:8 -msgid "" -"[pt1]: https://euandreh.xyz/remembering/pt/ [fr1]: https://euandreh.xyz/" -"remembering/fr/ [eo1]: https://euandreh.xyz/remembering/eo/" -msgstr "" - -#. type: Plain text -#: index.en.md:10 -msgid "Add memory to [`dmenu`][dmenu], [`fzf`][fzf] and similar tools." -msgstr "" - -#. type: Plain text -#: index.en.md:13 -msgid "" -"It can wrap such tools to accumulate preferences over time, and re-arrange " -"the input according to common picks." -msgstr "" - -#. type: Plain text -#: index.en.md:16 -msgid "## Usage" -msgstr "" - -#. type: Plain text -#: index.en.md:21 -msgid "Replace: ```shell $ ls | fzf ```" -msgstr "" - -#. type: Plain text -#: index.en.md:26 -msgid "with: ```shell $ ls | remembering -p fzf-sample -c fzf ```" -msgstr "" - -#. type: Plain text -#: index.en.md:28 -msgid "" -"and see your previous choices from `fzf` start to appear at the beginning of " -"the list." -msgstr "" - -#. type: Plain text -#: index.en.md:30 -msgid "" -"Similar to [`yeganesh`][yeganesh], but with no build-time or run-time " -"dependencies, and not coupled with `dmenu`." -msgstr "" - -#. type: Plain text -#: index.en.md:34 -msgid "" -"[dmenu]: https://tools.suckless.org/dmenu/ [fzf]: https://github.com/" -"junegunn/fzf [yeganesh]: http://dmwit.com/yeganesh/" -msgstr "" - -#. type: Plain text -#: index.en.md:37 -msgid "## Installation" -msgstr "" - -#. type: Plain text -#: index.en.md:43 -msgid "```shell $ make $ make check # make install ```" -msgstr "" - -#. type: Plain text -#: index.en.md:45 -msgid "You can pass `PREFIX` or `DESTDIR` to `make`:" -msgstr "" - -#. type: Plain text -#: index.en.md:51 -msgid "```shell $ make $ make check $ make install PREFIX=$HOME/.local ```" -msgstr "" - -#. type: Plain text -#: index.en.md:54 -msgid "" -"There are no dependencies or requirements, only standard tools such as POSIX " -"sed, POSIX make, etc." -msgstr "" - -#. type: Plain text -#: index.en.md:57 -msgid "## Documentation" -msgstr "" - -#. type: Plain text -#: index.en.md:59 -msgid "### Manuals" -msgstr "" - -#. type: Plain text -#: index.en.md:63 -msgid "" -"The documentation is available via installed manpages or online: - " -"[`remembering.1`] ([pt][pt.1], [fr][fr.1], [eo][eo.1]); - [`remembering.5`] " -"([pt][pt.5], [fr][fr.5], [eo][eo.5])." -msgstr "" - -#. type: Plain text -#: index.en.md:72 -msgid "" -"[`remembering.1`]: https://euandreh.xyz/remembering/en/remembering.1.html " -"[pt.1]: https://euandreh.xyz/remembering/pt/remembering.1.html [fr.1]: " -"https://euandreh.xyz/remembering/fr/remembering.1.html [eo.1]: https://" -"euandreh.xyz/remembering/eo/remembering.1.html [`remembering.5`]: https://" -"euandreh.xyz/remembering/en/remembering.5.html [pt.5]: https://euandreh.xyz/" -"remembering/pt/remembering.5.html [fr.5]: https://euandreh.xyz/remembering/" -"fr/remembering.5.html [eo.5]: https://euandreh.xyz/remembering/eo/" -"remembering.5.html" -msgstr "" - -#. type: Plain text -#: index.en.md:74 -msgid "### Directory structure" -msgstr "" - -#. type: Plain text -#: index.en.md:83 -#, no-wrap -msgid "" -"The directory structure of the repository is:\n" -"- `aux/`: personal scripts and helpers I've vendored in to ensure the\n" -" repository is self contained, feel free to ignore it;\n" -"- `doc/`: manpages, with their translated versions;\n" -"- `po/`: gettext `.po` files for the translated languages and hunspell\n" -" dictionaries for spell checking;\n" -"- `src/`: main source code for the project;\n" -"- `tests/`: integration tests for the project.\n" -msgstr "" - -#. type: Plain text -#: index.en.md:86 -msgid "## Contributing" -msgstr "" - -#. type: Plain text -#: index.en.md:93 -msgid "" -"Extra tools used for development are: - [Valgrind] for memory testing; - " -"[ShellCheck] for validating scripts; - [po4a], [mdpo] and [gettext] for i18n " -"and l10n support; - [makefile2graph] and [graphviz] for generating [makefile." -"svg]; - [pandoc] for generating the documentation HTML and website." -msgstr "" - -#. type: Plain text -#: index.en.md:103 -msgid "" -"[Valgrind]: https://valgrind.org [ShellCheck]: https://www.shellcheck.net/ " -"[po4a]: https://po4a.org/index.php.en [gettext]: https://www.gnu.org/" -"software/gettext/ [pandoc]: https://pandoc.org/ [mdpo]: https://mdpo." -"readthedocs.io/en/master/ [makefile2graph]: https://github.com/lindenb/" -"makefile2graph [graphviz]: https://graphviz.org/ [makefile.svg]: https://" -"euandreh.xyz/git-permalink/makefile.svg" -msgstr "" - -#. type: Plain text -#: index.en.md:105 -msgid "For running the extra development-only checks, run:" -msgstr "" - -#. type: Plain text -#: index.en.md:109 -msgid "```shell $ make dev-check ```" -msgstr "" - -#. type: Plain text -#: index.en.md:111 -msgid "and for generating the documentation HTML and website, run:" -msgstr "" - -#. type: Plain text -#: index.en.md:115 -msgid "```shell $ make public ```" -msgstr "" - -#. type: Plain text -#: index.en.md:118 -msgid "" -"Send contributions to the [mailing list] via [`git send-email`](https://git-" -"send-email.io/)." -msgstr "" - -#. type: Plain text -#: index.en.md:121 -msgid "## Links" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[homepage](https://euandre.org/s/remembering/en/)" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[source code](https://euandre.org/git/remembering/)" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[bug tracking](https://euandre.org/s/remembering/TODOs.html)" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[mailing list]" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[CI logs](https://euandre.org/s/remembering/ci/)" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[CHANGELOG](https://euandre.org/s/remembering/en/CHANGELOG.html)" -msgstr "" - -#. type: Plain text -#: index.en.md:130 -msgid "" -"[mailing list]: https://lists.sr.ht/~euandreh/public-inbox?search=" -"%5Bremembering%5D" -msgstr "" - -#. type: Plain text -#: index.en.md:133 -msgid "## Releases" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.3.0](https://euandre.org/git/remembering/commit/?id=v0.3.0) [remembering-" -"v0.3.0.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.3.0.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.3.0.tar.gz.asc)) - 2022-11-25" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.2.1](https://euandre.org/git/remembering/commit/?id=v0.2.1) [remembering-" -"v0.2.1.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.2.1.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.2.1.tar.gz.asc)) - 2021-02-23" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.2.0](https://euandre.org/git/remembering/commit/?id=v0.2.0) [remembering-" -"v0.2.0.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.2.0.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.2.0.tar.gz.asc)) - 2021-02-21" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.1.2](https://euandre.org/git/remembering/commit/?id=v0.1.2) [remembering-" -"v0.1.2.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.1.2.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.1.2.tar.gz.asc)) - 2021-01-26" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.1.1](https://euandre.org/git/remembering/commit/?id=v0.1.1) [remembering-" -"v0.1.1.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.1.1.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.1.1.tar.gz.asc)) - 2021-01-26" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.1.0](https://euandre.org/git/remembering/commit/?id=v0.1.0) [remembering-" -"v0.1.0.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.1.0.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.1.0.tar.gz.asc)) - 2021-01-26" -msgstr "" - -#. type: Plain text -#: index.en.md:143 -msgid "## License" -msgstr "" - -#. type: Plain text -#: index.en.md:147 -msgid "" -"The code is licensed under [GNU Affero General Public License v3.0 or later]" -"[AGPL-3.0-or-later] (AGPL-3.0-or-later)." -msgstr "" - -#. type: Plain text -#: index.en.md:148 -msgid "[AGPL-3.0-or-later]: https://euandre.org/git/remembering/tree/COPYING" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:11 -msgid "" -"<!-- Entry template: --> <!-- # Unreleased ## Added ## Changed ## Deprecated " -"## Removed ## Fixed ## Security -->" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:13 -msgid "Changelog for [remembering](https://euandre.org/remembering/en/)." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:16 -msgid "# Unreleased" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:19 -msgid "" -"# [0.3.0](https://euandre.org/git/remembering/commit/?id=v0.3.0) - 2022-11-25" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:21 CHANGELOG.en.md:99 CHANGELOG.en.md:124 -msgid "## Added" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:23 -msgid "### Inference of profiles" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:25 CHANGELOG.en.md:73 CHANGELOG.en.md:103 -msgid "## Changed" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:27 -msgid "### Remove `-c COMMAND` option" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:31 -msgid "" -"Instead of requiring a `-c COMMAND` option explicitly, instead receive the " -"commands to be ran as the \"rest\" argument to `remembering`, stored in `" -"$@`. The usage changes from:" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:35 -msgid "```shell $ remembering -p a-profile -c 'command $arg1 arg2' ```" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:37 -msgid "to:" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:41 -msgid "```shell $ remembering -p a-profile -- command $arg1 arg2 ```" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:51 -#, no-wrap -msgid "" -"The upsides are:\n" -"1. no need to worry about nested quotes: requiring a `-c COMMAND` option forced\n" -" one to wrap the command and args inside quotes, and the quotation used\n" -" influenced the command to be ran;\n" -"1. one less option to know about: instead of having to remember what is the\n" -" specific letter used for the command, just prefix the command with\n" -" `remembering`;\n" -"1. simpler and more powerful composition: wrapping commands without quoting them\n" -" allows one to use many of such tools in combination:\n" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:55 -msgid "```shell $ time nice -n10 timeout 3 remembering sleep 5 ```" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:57 -#, no-wrap -msgid " The equivalent with `-c COMMAND` would be:\n" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:61 -msgid "" -"```shell $ time -c 'nice -n10 -c \"timeout 3 -c 'remembering -c \"sleep " -"5\"'\"' ```" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:64 -#, no-wrap -msgid "" -" But instead of alternating between single and double quotes, properly quoting\n" -" them at each level.\n" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:66 CHANGELOG.en.md:110 CHANGELOG.en.md:117 -msgid "## Fixed" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:68 -msgid "### Improve speed" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:70 -msgid "Rewrite to make it faster" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:75 -msgid "### Use of `$XDG_DATA_HOME`" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:79 -msgid "" -"When the environment variable `$XDG_DATA_HOME` is defined, remembering now " -"appends a trailing `/remembering` to it instead of start writing files to " -"where the environment variable points to." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:81 -msgid "" -"This is in conformance with the [XDG Base Directory Specification][xdg]." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:83 -msgid "" -"[xdg]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-" -"latest.html" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:85 -msgid "### Exit code" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:87 -msgid "" -"When remembering encounters an unrecognized option, it now exits with 2 " -"instead of ignoring it." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:90 -msgid "" -"# [0.2.1](https://euandre.org/git/remembering/commit/?id=v0.2.1) - 2021-02-23" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:92 -msgid "## Removed" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:94 -msgid "Revert to plain `Makefile` over `./configure` + `Makefile.in`." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:97 -msgid "" -"# [0.2.0](https://euandre.org/git/remembering/commit/?id=v0.2.0) - 2021-02-21" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:101 -msgid "Add trivial `./configure` script." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:105 -msgid "Assume standard input is already sorted for faster processing." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:108 -msgid "" -"# [0.1.2](https://euandre.org/git/remembering/commit/?id=v0.1.2) - 2021-01-26" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:112 -msgid "Replace usage of GNU Coreutils' specific `tac` utility with `sed`." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:115 -msgid "" -"# [0.1.1](https://euandre.org/git/remembering/commit/?id=v0.1.1) - 2021-01-26" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:119 -msgid "Allow names with spaces." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:122 -msgid "" -"# [0.1.0](https://euandre.org/git/remembering/commit/?id=v0.1.0) - 2021-01-26" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:125 -msgid "Initial public release." -msgstr "" - -#. type: Plain text -#: aux/checks/manpages/footer.en.0.in:2 -msgid ".SH AUTHORS" -msgstr "" - -#. type: Plain text -#: aux/checks/manpages/footer.en.0.in:7 -msgid ".MT eu@euandre.org EuAndreh .ME and contributors." -msgstr "" - -#. type: Plain text -#: aux/checks/manpages/footer.en.0.in:10 -msgid ".SH BUGS" -msgstr "" - -#. type: Plain text -#: aux/checks/manpages/footer.en.0.in:30 -msgid "" -".IP \\(bu Report bugs to the .MT ~euandreh/@MAILING_LIST@@lists.sr.ht " -"mailing list .ME . Use the subject \"\\f(CR[@NAME@] BUG or TASK: " -"<description>\\fR\". .IP \\(bu Browse bugs .UR https://@DOMAIN@/@NAME@/TODOs." -"html online .UE . .IP \\(bu .UR https://@DOMAIN@/@NAME@/en/ Homepage .UE . ." -"IP \\(bu .UR https://lists.sr.ht/~euandreh/@MAILING_LIST@?search=%5B@NAME@" -"%5D Comments and discussions .UE ." -msgstr "" diff --git a/po/po4a.cfg b/po/po4a.cfg deleted file mode 100644 index c6bf6e6..0000000 --- a/po/po4a.cfg +++ /dev/null @@ -1,9 +0,0 @@ -[options] --keep 0 --master-charset UTF-8 --localized-charset UTF-8 - -[po_directory] po - -[type: man] doc/remembering.en.1.in $lang:doc/remembering.$lang.1.in -[type: man] doc/remembering.en.5.in $lang:doc/remembering.$lang.5.in -[type: text] index.en.md $lang:index.$lang.md -[type: text] CHANGELOG.en.md $lang:CHANGELOG.$lang.md -[type: text] aux/checks/manpages/footer.en.0.in $lang:aux/checks/manpages/footer.$lang.0.in diff --git a/po/pt.po b/po/pt.po deleted file mode 100644 index 84026f0..0000000 --- a/po/pt.po +++ /dev/null @@ -1,1066 +0,0 @@ -#. type: TH -#: doc/remembering.en.1.in:1 doc/remembering.en.5.in:1 -#, no-wrap -msgid "REMEMBERING" -msgstr "" - -#. type: TH -#: doc/remembering.en.1.in:1 doc/remembering.en.5.in:1 -#, no-wrap -msgid "@DATE@" -msgstr "" - -#. type: TH -#: doc/remembering.en.1.in:1 doc/remembering.en.5.in:1 -#, no-wrap -msgid "remembering @VERSION@" -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:4 doc/remembering.en.5.in:4 -#, no-wrap -msgid "NAME" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:7 -msgid "remembering - sort list from I<STDIN> using past choices as weight." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:9 -#, no-wrap -msgid "SYNOPSYS" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:12 -msgid "B<remembering> B<-p> I<PROFILE> B<-c> I<COMMAND>" -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:14 -#, no-wrap -msgid "DESCRIPTION" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:17 -msgid "" -"B<remembering> takes a command that chooses an option as its behaviour, such " -"as B<fzf>(1) or B<dmenu>(1), and I<remembers> what option is chosen, and as " -"it is used, will put the most used choices at the beginning of the list." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:20 -msgid "" -"B<remembering> reads from STDIN and writes to STDOUT. It expects STDIN to " -"be sorted." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:22 -#, no-wrap -msgid "OPTIONS" -msgstr "" - -#. type: TP -#: doc/remembering.en.1.in:24 -#, no-wrap -msgid "B<-c> I<COMMAND>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:27 -msgid "The I<COMMAND> to be executed, reading from standard input (STDIN)." -msgstr "" - -#. type: TP -#: doc/remembering.en.1.in:28 -#, no-wrap -msgid "B<-p> I<PROFILE>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:31 -msgid "The name of the I<PROFILE> where to look up and store raking data." -msgstr "" - -#. type: TP -#: doc/remembering.en.1.in:32 -#, no-wrap -msgid "B<-h>, B<--help>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:35 -msgid "Show short help text." -msgstr "" - -#. type: TP -#: doc/remembering.en.1.in:36 -#, no-wrap -msgid "B<-V>, B<--version>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:39 -msgid "Show version number." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:41 -#, no-wrap -msgid "EXAMPLES" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:44 -msgid "List current directory and feed it to B<fzf>(1) via B<remembering>:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:48 -#, no-wrap -msgid "$ ls | remembering -p fzf-ls -c fzf\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:53 -msgid "" -"Lists all executables available in I<$PATH>, and feed those to B<dmenu>(1) " -"via B<remembering>, and execute with B<sh>(1) the choice picked:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:57 -#, no-wrap -msgid "$ dmenu_path | remembering -p dmenu-exe -c 'dmenu' | sh\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:62 -msgid "Successive invocations will put the frequent choices at the beginning." -msgstr "" - -#. type: SS -#: doc/remembering.en.1.in:63 -#, no-wrap -msgid "Simulation of an interactive session" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:66 -msgid "" -"Below is a simulation of an interactive session, comparing the usage of " -"plain B<fzf>(1) against composing it with B<remembering>:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:75 -#, no-wrap -msgid "" -"$ mkdir -p example/\n" -"$ cd example/\n" -"$ touch a b c d e\n" -"$ ls\n" -"a b c d e\n" -"$ ls | fzf\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:79 -msgid "" -"We begin creating a sample directory called \"\\f(CRexample/\\fR\", we cd " -"into it and create 5 empty files: a, b, c, d and e." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:81 -msgid "" -"\\f(CRls\\fR can list the directory for us, in this case in alphabetical " -"order." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:83 -msgid "" -"When we pipe the output of \\f(CRls\\fR into B<fzf>(1), we are give given " -"its prompt to pick one option:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:93 doc/remembering.en.1.in:120 -#: doc/remembering.en.1.in:141 -#, no-wrap -msgid "" -" e\n" -" d\n" -" c\n" -" b\n" -"E<gt> a\n" -" 5/5\n" -"E<gt>\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:97 -msgid "" -"Here B<fzf>(1) lists the items it gets from I<STDIN> in the order that it " -"was given, and starts at the first one, \"a\"." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:99 -msgid "" -"Once we type \"d\" and press return, the output of B<fzf>(1) is the choice:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:104 doc/remembering.en.1.in:123 -#, no-wrap -msgid "" -"$ ls | fzf\n" -"d\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:108 -msgid "" -"Now if we run the same command again, we'll be given the same options, in " -"the same order:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:112 -#, no-wrap -msgid "$ ls | fzf\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:127 -msgid "" -"B<fzf>(1) is doing what it is told to: making a prompt with the options " -"given to it from I<STDIN>, in the order it was given." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:129 -msgid "" -"In order to have our past choices show up in the beginning of the list, we " -"can compose B<fzf>(1) with B<remembering>:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:133 doc/remembering.en.1.in:155 -#, no-wrap -msgid "$ ls | remembering -p tutorial-example -c 'fzf'\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:144 doc/remembering.en.1.in:166 -#, no-wrap -msgid "" -"$ ls | remembering -p tutorial-example -c 'fzf'\n" -"d\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:149 -msgid "" -"So far we get the exact same behaviour, but saying extra things. We tell " -"B<remembering> that we want this specific I<PROFILE> to be called " -"\"\\f(CRtutorial-example\\fR\", and we give B<remembering> the " -"\\f(CR'fzf'\\fR command to be ran." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:151 -msgid "" -"From now on if we run the exact same command again, B<remembering> will " -"I<remember> that the last choice was \"d\", and put it in the beginning of " -"the list, which B<fzf>(1) happily displays in the order it was given:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:163 -#, no-wrap -msgid "" -" e\n" -" c\n" -" b\n" -" a\n" -"E<gt> d\n" -" 5/5\n" -"E<gt>\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:170 -msgid "" -"This time the \"d\" option was already the first one, and we can just press " -"return to get it as the output value from the command." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:172 -msgid "" -"This example used B<fzf>(1) as the I<COMMAND> given to B<remembering>, but " -"you can give to the B<-c> option anything that reads from I<STDIN>, picks a " -"line and writes to B<STDOUT>." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:174 doc/remembering.en.5.in:60 -#, no-wrap -msgid "SEE ALSO" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:177 -msgid "B<remembering>(5)" -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:179 doc/remembering.en.5.in:65 -#, no-wrap -msgid "AUTHORS" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:185 doc/remembering.en.5.in:71 -msgid "E<.MT eu@euandre.org> EuAndreh E<.ME> and contributors." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:187 doc/remembering.en.5.in:73 -#, no-wrap -msgid "BUGS" -msgstr "" - -#. type: IP -#: doc/remembering.en.1.in:189 doc/remembering.en.1.in:196 -#: doc/remembering.en.1.in:201 doc/remembering.en.1.in:205 -#: doc/remembering.en.5.in:75 doc/remembering.en.5.in:82 -#: doc/remembering.en.5.in:87 doc/remembering.en.5.in:91 -#, no-wrap -msgid "\\(bu" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:196 doc/remembering.en.5.in:82 -msgid "" -"Report bugs to the E<.MT ~euandreh/public-inbox@lists.sr.ht> mailing list E<." -"ME .> Use the subject \"\\f(CR[remembering] BUG or TASK: " -"E<lt>descriptionE<gt>\\fR\"." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:201 doc/remembering.en.5.in:87 -msgid "" -"Browse bugs E<.UR https://euandreh.xyz/remembering/TODOs.html> online E<.UE ." -">" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:205 doc/remembering.en.5.in:91 -msgid "E<.UR https://euandreh.xyz/remembering/en/> Homepage E<.UE .>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:208 doc/remembering.en.5.in:94 -msgid "" -"E<.UR https://lists.sr.ht/~euandreh/public-inbox?search=%5Bremembering%5D> " -"Comments and discussions E<.UE .>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:7 -msgid "remembering - format of the I<PROFILE> text file." -msgstr "" - -#. type: SH -#: doc/remembering.en.5.in:9 -#, no-wrap -msgid "PROFILE" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:13 -msgid "" -"The I<PROFILE> is a text file, stored on \\f(CR$XDG_DATA_HOME/remembering/" -"profile-name\\fR if \\f(CR$XDG_DATA_HOME\\fR is defined. Otherwise, it " -"lives in \\f(CR~/.local/share/remembering/profile-name\\fR." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:15 -msgid "Each line of the I<PROFILE> contains three pieces of information:" -msgstr "" - -#. type: IP -#: doc/remembering.en.5.in:17 -#, no-wrap -msgid "1" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:19 -msgid "the B<rank> of the current entry;" -msgstr "" - -#. type: IP -#: doc/remembering.en.5.in:19 -#, no-wrap -msgid "2" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:21 -msgid "the \\f(CR:\\fR separator;" -msgstr "" - -#. type: IP -#: doc/remembering.en.5.in:21 -#, no-wrap -msgid "3" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:23 -msgid "the B<entry> itself." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:26 -msgid "" -"The B<rank> is a number, and the B<entry> is all the text until the end of " -"the line after the \\f(CR:\\fR separator:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:34 -#, no-wrap -msgid "" -"0:an entry\n" -"0:banana\n" -"0:entry\n" -"0:something\n" -"0:zzz\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:38 -msgid "" -"Above is an example of a I<PROFILE> file where all the entries have the " -"default B<rank> value: B<0>." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:40 -msgid "" -"If the I<COMMAND> runs and chooses \\f(CRbanana\\fR, the new I<PROFILE> will " -"be:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:48 -#, no-wrap -msgid "" -"0:an entry\n" -"1:banana\n" -"0:entry\n" -"0:something\n" -"0:zzz\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:52 -msgid "" -"Now the next time the I<COMMAND> runs it will get \\f(CRbanana\\fR at the " -"beginning of the list, and as new picks happen their weight will increase, " -"and will keep going up in priority." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:55 -msgid "" -"The entries of the I<PROFILE> are created and kept sorted. " -"B<remembering>(1) expects to always find sorted entries in the I<PROFILE>." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:58 -msgid "" -"The current raking algorithm increments entries as a simple counter. Every " -"time an entry is picked, its ranked is incremented in the I<PROFILE>." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:63 -msgid "B<remembering>(1)" -msgstr "" - -#. type: Plain text -#: index.en.md:2 -msgid "# remembering" -msgstr "" - -#. type: Plain text -#: index.en.md:4 -msgid "[pt][pt1] | [fr][fr1] | [eo][eo1]" -msgstr "" - -#. type: Plain text -#: index.en.md:8 -msgid "" -"[pt1]: https://euandreh.xyz/remembering/pt/ [fr1]: https://euandreh.xyz/" -"remembering/fr/ [eo1]: https://euandreh.xyz/remembering/eo/" -msgstr "" - -#. type: Plain text -#: index.en.md:10 -msgid "Add memory to [`dmenu`][dmenu], [`fzf`][fzf] and similar tools." -msgstr "" - -#. type: Plain text -#: index.en.md:13 -msgid "" -"It can wrap such tools to accumulate preferences over time, and re-arrange " -"the input according to common picks." -msgstr "" - -#. type: Plain text -#: index.en.md:16 -msgid "## Usage" -msgstr "" - -#. type: Plain text -#: index.en.md:21 -msgid "Replace: ```shell $ ls | fzf ```" -msgstr "" - -#. type: Plain text -#: index.en.md:26 -msgid "with: ```shell $ ls | remembering -p fzf-sample -c fzf ```" -msgstr "" - -#. type: Plain text -#: index.en.md:28 -msgid "" -"and see your previous choices from `fzf` start to appear at the beginning of " -"the list." -msgstr "" - -#. type: Plain text -#: index.en.md:30 -msgid "" -"Similar to [`yeganesh`][yeganesh], but with no build-time or run-time " -"dependencies, and not coupled with `dmenu`." -msgstr "" - -#. type: Plain text -#: index.en.md:34 -msgid "" -"[dmenu]: https://tools.suckless.org/dmenu/ [fzf]: https://github.com/" -"junegunn/fzf [yeganesh]: http://dmwit.com/yeganesh/" -msgstr "" - -#. type: Plain text -#: index.en.md:37 -msgid "## Installation" -msgstr "" - -#. type: Plain text -#: index.en.md:43 -msgid "```shell $ make $ make check # make install ```" -msgstr "" - -#. type: Plain text -#: index.en.md:45 -msgid "You can pass `PREFIX` or `DESTDIR` to `make`:" -msgstr "" - -#. type: Plain text -#: index.en.md:51 -msgid "```shell $ make $ make check $ make install PREFIX=$HOME/.local ```" -msgstr "" - -#. type: Plain text -#: index.en.md:54 -msgid "" -"There are no dependencies or requirements, only standard tools such as POSIX " -"sed, POSIX make, etc." -msgstr "" - -#. type: Plain text -#: index.en.md:57 -msgid "## Documentation" -msgstr "" - -#. type: Plain text -#: index.en.md:59 -msgid "### Manuals" -msgstr "" - -#. type: Plain text -#: index.en.md:63 -msgid "" -"The documentation is available via installed manpages or online: - " -"[`remembering.1`] ([pt][pt.1], [fr][fr.1], [eo][eo.1]); - [`remembering.5`] " -"([pt][pt.5], [fr][fr.5], [eo][eo.5])." -msgstr "" - -#. type: Plain text -#: index.en.md:72 -msgid "" -"[`remembering.1`]: https://euandreh.xyz/remembering/en/remembering.1.html " -"[pt.1]: https://euandreh.xyz/remembering/pt/remembering.1.html [fr.1]: " -"https://euandreh.xyz/remembering/fr/remembering.1.html [eo.1]: https://" -"euandreh.xyz/remembering/eo/remembering.1.html [`remembering.5`]: https://" -"euandreh.xyz/remembering/en/remembering.5.html [pt.5]: https://euandreh.xyz/" -"remembering/pt/remembering.5.html [fr.5]: https://euandreh.xyz/remembering/" -"fr/remembering.5.html [eo.5]: https://euandreh.xyz/remembering/eo/" -"remembering.5.html" -msgstr "" - -#. type: Plain text -#: index.en.md:74 -msgid "### Directory structure" -msgstr "" - -#. type: Plain text -#: index.en.md:83 -#, no-wrap -msgid "" -"The directory structure of the repository is:\n" -"- `aux/`: personal scripts and helpers I've vendored in to ensure the\n" -" repository is self contained, feel free to ignore it;\n" -"- `doc/`: manpages, with their translated versions;\n" -"- `po/`: gettext `.po` files for the translated languages and hunspell\n" -" dictionaries for spell checking;\n" -"- `src/`: main source code for the project;\n" -"- `tests/`: integration tests for the project.\n" -msgstr "" - -#. type: Plain text -#: index.en.md:86 -msgid "## Contributing" -msgstr "" - -#. type: Plain text -#: index.en.md:93 -msgid "" -"Extra tools used for development are: - [Valgrind] for memory testing; - " -"[ShellCheck] for validating scripts; - [po4a], [mdpo] and [gettext] for i18n " -"and l10n support; - [makefile2graph] and [graphviz] for generating [makefile." -"svg]; - [pandoc] for generating the documentation HTML and website." -msgstr "" - -#. type: Plain text -#: index.en.md:103 -msgid "" -"[Valgrind]: https://valgrind.org [ShellCheck]: https://www.shellcheck.net/ " -"[po4a]: https://po4a.org/index.php.en [gettext]: https://www.gnu.org/" -"software/gettext/ [pandoc]: https://pandoc.org/ [mdpo]: https://mdpo." -"readthedocs.io/en/master/ [makefile2graph]: https://github.com/lindenb/" -"makefile2graph [graphviz]: https://graphviz.org/ [makefile.svg]: https://" -"euandreh.xyz/git-permalink/makefile.svg" -msgstr "" - -#. type: Plain text -#: index.en.md:105 -msgid "For running the extra development-only checks, run:" -msgstr "" - -#. type: Plain text -#: index.en.md:109 -msgid "```shell $ make dev-check ```" -msgstr "" - -#. type: Plain text -#: index.en.md:111 -msgid "and for generating the documentation HTML and website, run:" -msgstr "" - -#. type: Plain text -#: index.en.md:115 -msgid "```shell $ make public ```" -msgstr "" - -#. type: Plain text -#: index.en.md:118 -msgid "" -"Send contributions to the [mailing list] via [`git send-email`](https://git-" -"send-email.io/)." -msgstr "" - -#. type: Plain text -#: index.en.md:121 -msgid "## Links" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[homepage](https://euandre.org/s/remembering/en/)" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[source code](https://euandre.org/git/remembering/)" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[bug tracking](https://euandre.org/s/remembering/TODOs.html)" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[mailing list]" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[CI logs](https://euandre.org/s/remembering/ci/)" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -msgid "[CHANGELOG](https://euandre.org/s/remembering/en/CHANGELOG.html)" -msgstr "" - -#. type: Plain text -#: index.en.md:130 -msgid "" -"[mailing list]: https://lists.sr.ht/~euandreh/public-inbox?search=" -"%5Bremembering%5D" -msgstr "" - -#. type: Plain text -#: index.en.md:133 -msgid "## Releases" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.3.0](https://euandre.org/git/remembering/commit/?id=v0.3.0) [remembering-" -"v0.3.0.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.3.0.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.3.0.tar.gz.asc)) - 2022-11-25" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.2.1](https://euandre.org/git/remembering/commit/?id=v0.2.1) [remembering-" -"v0.2.1.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.2.1.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.2.1.tar.gz.asc)) - 2021-02-23" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.2.0](https://euandre.org/git/remembering/commit/?id=v0.2.0) [remembering-" -"v0.2.0.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.2.0.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.2.0.tar.gz.asc)) - 2021-02-21" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.1.2](https://euandre.org/git/remembering/commit/?id=v0.1.2) [remembering-" -"v0.1.2.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.1.2.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.1.2.tar.gz.asc)) - 2021-01-26" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.1.1](https://euandre.org/git/remembering/commit/?id=v0.1.1) [remembering-" -"v0.1.1.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.1.1.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.1.1.tar.gz.asc)) - 2021-01-26" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -msgid "" -"[v0.1.0](https://euandre.org/git/remembering/commit/?id=v0.1.0) [remembering-" -"v0.1.0.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-" -"v0.1.0.tar.gz) ([sig](https://euandre.org/git/remembering/snapshot/" -"remembering-v0.1.0.tar.gz.asc)) - 2021-01-26" -msgstr "" - -#. type: Plain text -#: index.en.md:143 -msgid "## License" -msgstr "" - -#. type: Plain text -#: index.en.md:147 -msgid "" -"The code is licensed under [GNU Affero General Public License v3.0 or later]" -"[AGPL-3.0-or-later] (AGPL-3.0-or-later)." -msgstr "" - -#. type: Plain text -#: index.en.md:148 -msgid "[AGPL-3.0-or-later]: https://euandre.org/git/remembering/tree/COPYING" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:11 -msgid "" -"<!-- Entry template: --> <!-- # Unreleased ## Added ## Changed ## Deprecated " -"## Removed ## Fixed ## Security -->" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:13 -msgid "Changelog for [remembering](https://euandre.org/remembering/en/)." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:16 -msgid "# Unreleased" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:19 -msgid "" -"# [0.3.0](https://euandre.org/git/remembering/commit/?id=v0.3.0) - 2022-11-25" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:21 CHANGELOG.en.md:99 CHANGELOG.en.md:124 -msgid "## Added" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:23 -msgid "### Inference of profiles" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:25 CHANGELOG.en.md:73 CHANGELOG.en.md:103 -msgid "## Changed" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:27 -msgid "### Remove `-c COMMAND` option" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:31 -msgid "" -"Instead of requiring a `-c COMMAND` option explicitly, instead receive the " -"commands to be ran as the \"rest\" argument to `remembering`, stored in `" -"$@`. The usage changes from:" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:35 -msgid "```shell $ remembering -p a-profile -c 'command $arg1 arg2' ```" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:37 -msgid "to:" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:41 -msgid "```shell $ remembering -p a-profile -- command $arg1 arg2 ```" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:51 -#, no-wrap -msgid "" -"The upsides are:\n" -"1. no need to worry about nested quotes: requiring a `-c COMMAND` option forced\n" -" one to wrap the command and args inside quotes, and the quotation used\n" -" influenced the command to be ran;\n" -"1. one less option to know about: instead of having to remember what is the\n" -" specific letter used for the command, just prefix the command with\n" -" `remembering`;\n" -"1. simpler and more powerful composition: wrapping commands without quoting them\n" -" allows one to use many of such tools in combination:\n" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:55 -msgid "```shell $ time nice -n10 timeout 3 remembering sleep 5 ```" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:57 -#, no-wrap -msgid " The equivalent with `-c COMMAND` would be:\n" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:61 -msgid "" -"```shell $ time -c 'nice -n10 -c \"timeout 3 -c 'remembering -c \"sleep " -"5\"'\"' ```" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:64 -#, no-wrap -msgid "" -" But instead of alternating between single and double quotes, properly quoting\n" -" them at each level.\n" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:66 CHANGELOG.en.md:110 CHANGELOG.en.md:117 -msgid "## Fixed" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:68 -msgid "### Improve speed" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:70 -msgid "Rewrite to make it faster" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:75 -msgid "### Use of `$XDG_DATA_HOME`" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:79 -msgid "" -"When the environment variable `$XDG_DATA_HOME` is defined, remembering now " -"appends a trailing `/remembering` to it instead of start writing files to " -"where the environment variable points to." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:81 -msgid "" -"This is in conformance with the [XDG Base Directory Specification][xdg]." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:83 -msgid "" -"[xdg]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-" -"latest.html" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:85 -msgid "### Exit code" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:87 -msgid "" -"When remembering encounters an unrecognized option, it now exits with 2 " -"instead of ignoring it." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:90 -msgid "" -"# [0.2.1](https://euandre.org/git/remembering/commit/?id=v0.2.1) - 2021-02-23" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:92 -msgid "## Removed" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:94 -msgid "Revert to plain `Makefile` over `./configure` + `Makefile.in`." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:97 -msgid "" -"# [0.2.0](https://euandre.org/git/remembering/commit/?id=v0.2.0) - 2021-02-21" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:101 -msgid "Add trivial `./configure` script." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:105 -msgid "Assume standard input is already sorted for faster processing." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:108 -msgid "" -"# [0.1.2](https://euandre.org/git/remembering/commit/?id=v0.1.2) - 2021-01-26" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:112 -msgid "Replace usage of GNU Coreutils' specific `tac` utility with `sed`." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:115 -msgid "" -"# [0.1.1](https://euandre.org/git/remembering/commit/?id=v0.1.1) - 2021-01-26" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:119 -msgid "Allow names with spaces." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:122 -msgid "" -"# [0.1.0](https://euandre.org/git/remembering/commit/?id=v0.1.0) - 2021-01-26" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:125 -msgid "Initial public release." -msgstr "" - -#. type: Plain text -#: aux/checks/manpages/footer.en.0.in:2 -msgid ".SH AUTHORS" -msgstr "" - -#. type: Plain text -#: aux/checks/manpages/footer.en.0.in:7 -msgid ".MT eu@euandre.org EuAndreh .ME and contributors." -msgstr "" - -#. type: Plain text -#: aux/checks/manpages/footer.en.0.in:10 -msgid ".SH BUGS" -msgstr "" - -#. type: Plain text -#: aux/checks/manpages/footer.en.0.in:30 -msgid "" -".IP \\(bu Report bugs to the .MT ~euandreh/@MAILING_LIST@@lists.sr.ht " -"mailing list .ME . Use the subject \"\\f(CR[@NAME@] BUG or TASK: " -"<description>\\fR\". .IP \\(bu Browse bugs .UR https://@DOMAIN@/@NAME@/TODOs." -"html online .UE . .IP \\(bu .UR https://@DOMAIN@/@NAME@/en/ Homepage .UE . ." -"IP \\(bu .UR https://lists.sr.ht/~euandreh/@MAILING_LIST@?search=%5B@NAME@" -"%5D Comments and discussions .UE ." -msgstr "" diff --git a/po/remembering.pot b/po/remembering.pot deleted file mode 100644 index ce17c1a..0000000 --- a/po/remembering.pot +++ /dev/null @@ -1,1108 +0,0 @@ -# SOME DESCRIPTIVE TITLE -# Copyright (C) YEAR Free Software Foundation, Inc. -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2023-04-02 07:31-0300\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" -"Language-Team: LANGUAGE <LL@li.org>\n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#. type: TH -#: doc/remembering.en.1.in:1 doc/remembering.en.5.in:1 -#, no-wrap -msgid "REMEMBERING" -msgstr "" - -#. type: TH -#: doc/remembering.en.1.in:1 doc/remembering.en.5.in:1 -#, no-wrap -msgid "@DATE@" -msgstr "" - -#. type: TH -#: doc/remembering.en.1.in:1 doc/remembering.en.5.in:1 -#, no-wrap -msgid "remembering @VERSION@" -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:4 doc/remembering.en.5.in:4 -#, no-wrap -msgid "NAME" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:7 -msgid "remembering - sort list from I<STDIN> using past choices as weight." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:9 -#, no-wrap -msgid "SYNOPSYS" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:12 -msgid "B<remembering> B<-p> I<PROFILE> B<-c> I<COMMAND>" -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:14 -#, no-wrap -msgid "DESCRIPTION" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:17 -msgid "" -"B<remembering> takes a command that chooses an option as its behaviour, such " -"as B<fzf>(1) or B<dmenu>(1), and I<remembers> what option is chosen, and as " -"it is used, will put the most used choices at the beginning of the list." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:20 -msgid "" -"B<remembering> reads from STDIN and writes to STDOUT. It expects STDIN to " -"be sorted." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:22 -#, no-wrap -msgid "OPTIONS" -msgstr "" - -#. type: TP -#: doc/remembering.en.1.in:24 -#, no-wrap -msgid "B<-c> I<COMMAND>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:27 -msgid "The I<COMMAND> to be executed, reading from standard input (STDIN)." -msgstr "" - -#. type: TP -#: doc/remembering.en.1.in:28 -#, no-wrap -msgid "B<-p> I<PROFILE>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:31 -msgid "The name of the I<PROFILE> where to look up and store raking data." -msgstr "" - -#. type: TP -#: doc/remembering.en.1.in:32 -#, no-wrap -msgid "B<-h>, B<--help>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:35 -msgid "Show short help text." -msgstr "" - -#. type: TP -#: doc/remembering.en.1.in:36 -#, no-wrap -msgid "B<-V>, B<--version>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:39 -msgid "Show version number." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:41 -#, no-wrap -msgid "EXAMPLES" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:44 -msgid "List current directory and feed it to B<fzf>(1) via B<remembering>:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:48 -#, no-wrap -msgid "$ ls | remembering -p fzf-ls -c fzf\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:53 -msgid "" -"Lists all executables available in I<$PATH>, and feed those to B<dmenu>(1) " -"via B<remembering>, and execute with B<sh>(1) the choice picked:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:57 -#, no-wrap -msgid "$ dmenu_path | remembering -p dmenu-exe -c 'dmenu' | sh\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:62 -msgid "Successive invocations will put the frequent choices at the beginning." -msgstr "" - -#. type: SS -#: doc/remembering.en.1.in:63 -#, no-wrap -msgid "Simulation of an interactive session" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:66 -msgid "" -"Below is a simulation of an interactive session, comparing the usage of " -"plain B<fzf>(1) against composing it with B<remembering>:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:75 -#, no-wrap -msgid "" -"$ mkdir -p example/\n" -"$ cd example/\n" -"$ touch a b c d e\n" -"$ ls\n" -"a b c d e\n" -"$ ls | fzf\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:79 -msgid "" -"We begin creating a sample directory called \"\\f(CRexample/\\fR\", we cd " -"into it and create 5 empty files: a, b, c, d and e." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:81 -msgid "" -"\\f(CRls\\fR can list the directory for us, in this case in alphabetical " -"order." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:83 -msgid "" -"When we pipe the output of \\f(CRls\\fR into B<fzf>(1), we are give given " -"its prompt to pick one option:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:93 doc/remembering.en.1.in:120 -#: doc/remembering.en.1.in:141 -#, no-wrap -msgid "" -" e\n" -" d\n" -" c\n" -" b\n" -"E<gt> a\n" -" 5/5\n" -"E<gt>\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:97 -msgid "" -"Here B<fzf>(1) lists the items it gets from I<STDIN> in the order that it " -"was given, and starts at the first one, \"a\"." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:99 -msgid "Once we type \"d\" and press return, the output of B<fzf>(1) is the choice:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:104 doc/remembering.en.1.in:123 -#, no-wrap -msgid "" -"$ ls | fzf\n" -"d\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:108 -msgid "" -"Now if we run the same command again, we'll be given the same options, in " -"the same order:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:112 -#, no-wrap -msgid "$ ls | fzf\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:127 -msgid "" -"B<fzf>(1) is doing what it is told to: making a prompt with the options " -"given to it from I<STDIN>, in the order it was given." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:129 -msgid "" -"In order to have our past choices show up in the beginning of the list, we " -"can compose B<fzf>(1) with B<remembering>:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:133 doc/remembering.en.1.in:155 -#, no-wrap -msgid "$ ls | remembering -p tutorial-example -c 'fzf'\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:144 doc/remembering.en.1.in:166 -#, no-wrap -msgid "" -"$ ls | remembering -p tutorial-example -c 'fzf'\n" -"d\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:149 -msgid "" -"So far we get the exact same behaviour, but saying extra things. We tell " -"B<remembering> that we want this specific I<PROFILE> to be called " -"\"\\f(CRtutorial-example\\fR\", and we give B<remembering> the " -"\\f(CR'fzf'\\fR command to be ran." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:151 -msgid "" -"From now on if we run the exact same command again, B<remembering> will " -"I<remember> that the last choice was \"d\", and put it in the beginning of " -"the list, which B<fzf>(1) happily displays in the order it was given:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:163 -#, no-wrap -msgid "" -" e\n" -" c\n" -" b\n" -" a\n" -"E<gt> d\n" -" 5/5\n" -"E<gt>\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:170 -msgid "" -"This time the \"d\" option was already the first one, and we can just press " -"return to get it as the output value from the command." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:172 -msgid "" -"This example used B<fzf>(1) as the I<COMMAND> given to B<remembering>, but " -"you can give to the B<-c> option anything that reads from I<STDIN>, picks a " -"line and writes to B<STDOUT>." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:174 doc/remembering.en.5.in:60 -#, no-wrap -msgid "SEE ALSO" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:177 -msgid "B<remembering>(5)" -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:179 doc/remembering.en.5.in:65 -#, no-wrap -msgid "AUTHORS" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:185 doc/remembering.en.5.in:71 -msgid "E<.MT eu@euandre.org> EuAndreh E<.ME> and contributors." -msgstr "" - -#. type: SH -#: doc/remembering.en.1.in:187 doc/remembering.en.5.in:73 -#, no-wrap -msgid "BUGS" -msgstr "" - -#. type: IP -#: doc/remembering.en.1.in:189 doc/remembering.en.1.in:196 -#: doc/remembering.en.1.in:201 doc/remembering.en.1.in:205 -#: doc/remembering.en.5.in:75 doc/remembering.en.5.in:82 -#: doc/remembering.en.5.in:87 doc/remembering.en.5.in:91 -#, no-wrap -msgid "\\(bu" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:196 doc/remembering.en.5.in:82 -msgid "" -"Report bugs to the E<.MT ~euandreh/public-inbox@lists.sr.ht> mailing list " -"E<.ME .> Use the subject \"\\f(CR[remembering] BUG or TASK: " -"E<lt>descriptionE<gt>\\fR\"." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:201 doc/remembering.en.5.in:87 -msgid "" -"Browse bugs E<.UR https://euandreh.xyz/remembering/TODOs.html> online E<.UE " -".>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:205 doc/remembering.en.5.in:91 -msgid "E<.UR https://euandreh.xyz/remembering/en/> Homepage E<.UE .>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.1.in:208 doc/remembering.en.5.in:94 -msgid "" -"E<.UR https://lists.sr.ht/~euandreh/public-inbox?search=%5Bremembering%5D> " -"Comments and discussions E<.UE .>" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:7 -msgid "remembering - format of the I<PROFILE> text file." -msgstr "" - -#. type: SH -#: doc/remembering.en.5.in:9 -#, no-wrap -msgid "PROFILE" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:13 -msgid "" -"The I<PROFILE> is a text file, stored on " -"\\f(CR$XDG_DATA_HOME/remembering/profile-name\\fR if " -"\\f(CR$XDG_DATA_HOME\\fR is defined. Otherwise, it lives in " -"\\f(CR~/.local/share/remembering/profile-name\\fR." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:15 -msgid "Each line of the I<PROFILE> contains three pieces of information:" -msgstr "" - -#. type: IP -#: doc/remembering.en.5.in:17 -#, no-wrap -msgid "1" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:19 -msgid "the B<rank> of the current entry;" -msgstr "" - -#. type: IP -#: doc/remembering.en.5.in:19 -#, no-wrap -msgid "2" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:21 -msgid "the \\f(CR:\\fR separator;" -msgstr "" - -#. type: IP -#: doc/remembering.en.5.in:21 -#, no-wrap -msgid "3" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:23 -msgid "the B<entry> itself." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:26 -msgid "" -"The B<rank> is a number, and the B<entry> is all the text until the end of " -"the line after the \\f(CR:\\fR separator:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:34 -#, no-wrap -msgid "" -"0:an entry\n" -"0:banana\n" -"0:entry\n" -"0:something\n" -"0:zzz\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:38 -msgid "" -"Above is an example of a I<PROFILE> file where all the entries have the " -"default B<rank> value: B<0>." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:40 -msgid "" -"If the I<COMMAND> runs and chooses \\f(CRbanana\\fR, the new I<PROFILE> will " -"be:" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:48 -#, no-wrap -msgid "" -"0:an entry\n" -"1:banana\n" -"0:entry\n" -"0:something\n" -"0:zzz\n" -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:52 -msgid "" -"Now the next time the I<COMMAND> runs it will get \\f(CRbanana\\fR at the " -"beginning of the list, and as new picks happen their weight will increase, " -"and will keep going up in priority." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:55 -msgid "" -"The entries of the I<PROFILE> are created and kept sorted. " -"B<remembering>(1) expects to always find sorted entries in the I<PROFILE>." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:58 -msgid "" -"The current raking algorithm increments entries as a simple counter. Every " -"time an entry is picked, its ranked is incremented in the I<PROFILE>." -msgstr "" - -#. type: Plain text -#: doc/remembering.en.5.in:63 -msgid "B<remembering>(1)" -msgstr "" - -#. type: Plain text -#: index.en.md:2 -msgid "# remembering" -msgstr "" - -#. type: Plain text -#: index.en.md:4 -msgid "[pt][pt1] | [fr][fr1] | [eo][eo1]" -msgstr "" - -#. type: Plain text -#: index.en.md:8 -msgid "" -"[pt1]: https://euandreh.xyz/remembering/pt/ [fr1]: " -"https://euandreh.xyz/remembering/fr/ [eo1]: " -"https://euandreh.xyz/remembering/eo/" -msgstr "" - -#. type: Plain text -#: index.en.md:10 -msgid "Add memory to [`dmenu`][dmenu], [`fzf`][fzf] and similar tools." -msgstr "" - -#. type: Plain text -#: index.en.md:13 -msgid "" -"It can wrap such tools to accumulate preferences over time, and re-arrange " -"the input according to common picks." -msgstr "" - -#. type: Plain text -#: index.en.md:16 -msgid "## Usage" -msgstr "" - -#. type: Plain text -#: index.en.md:21 -msgid "Replace: ```shell $ ls | fzf ```" -msgstr "" - -#. type: Plain text -#: index.en.md:26 -msgid "with: ```shell $ ls | remembering -p fzf-sample -c fzf ```" -msgstr "" - -#. type: Plain text -#: index.en.md:28 -msgid "" -"and see your previous choices from `fzf` start to appear at the beginning of " -"the list." -msgstr "" - -#. type: Plain text -#: index.en.md:30 -msgid "" -"Similar to [`yeganesh`][yeganesh], but with no build-time or run-time " -"dependencies, and not coupled with `dmenu`." -msgstr "" - -#. type: Plain text -#: index.en.md:34 -msgid "" -"[dmenu]: https://tools.suckless.org/dmenu/ [fzf]: " -"https://github.com/junegunn/fzf [yeganesh]: http://dmwit.com/yeganesh/" -msgstr "" - -#. type: Plain text -#: index.en.md:37 -msgid "## Installation" -msgstr "" - -#. type: Plain text -#: index.en.md:43 -msgid "```shell $ make $ make check # make install ```" -msgstr "" - -#. type: Plain text -#: index.en.md:45 -msgid "You can pass `PREFIX` or `DESTDIR` to `make`:" -msgstr "" - -#. type: Plain text -#: index.en.md:51 -msgid "```shell $ make $ make check $ make install PREFIX=$HOME/.local ```" -msgstr "" - -#. type: Plain text -#: index.en.md:54 -msgid "" -"There are no dependencies or requirements, only standard tools such as POSIX " -"sed, POSIX make, etc." -msgstr "" - -#. type: Plain text -#: index.en.md:57 -msgid "## Documentation" -msgstr "" - -#. type: Plain text -#: index.en.md:59 -msgid "### Manuals" -msgstr "" - -#. type: Plain text -#: index.en.md:63 -msgid "" -"The documentation is available via installed manpages or online: - " -"[`remembering.1`] ([pt][pt.1], [fr][fr.1], [eo][eo.1]); - [`remembering.5`] " -"([pt][pt.5], [fr][fr.5], [eo][eo.5])." -msgstr "" - -#. type: Plain text -#: index.en.md:72 -msgid "" -"[`remembering.1`]: https://euandreh.xyz/remembering/en/remembering.1.html " -"[pt.1]: https://euandreh.xyz/remembering/pt/remembering.1.html [fr.1]: " -"https://euandreh.xyz/remembering/fr/remembering.1.html [eo.1]: " -"https://euandreh.xyz/remembering/eo/remembering.1.html [`remembering.5`]: " -"https://euandreh.xyz/remembering/en/remembering.5.html [pt.5]: " -"https://euandreh.xyz/remembering/pt/remembering.5.html [fr.5]: " -"https://euandreh.xyz/remembering/fr/remembering.5.html [eo.5]: " -"https://euandreh.xyz/remembering/eo/remembering.5.html" -msgstr "" - -#. type: Plain text -#: index.en.md:74 -msgid "### Directory structure" -msgstr "" - -#. type: Plain text -#: index.en.md:83 -#, no-wrap -msgid "" -"The directory structure of the repository is:\n" -"- `aux/`: personal scripts and helpers I've vendored in to ensure the\n" -" repository is self contained, feel free to ignore it;\n" -"- `doc/`: manpages, with their translated versions;\n" -"- `po/`: gettext `.po` files for the translated languages and hunspell\n" -" dictionaries for spell checking;\n" -"- `src/`: main source code for the project;\n" -"- `tests/`: integration tests for the project.\n" -msgstr "" - -#. type: Plain text -#: index.en.md:86 -msgid "## Contributing" -msgstr "" - -#. type: Plain text -#: index.en.md:93 -msgid "" -"Extra tools used for development are: - [Valgrind] for memory testing; - " -"[ShellCheck] for validating scripts; - [po4a], [mdpo] and [gettext] for i18n " -"and l10n support; - [makefile2graph] and [graphviz] for generating " -"[makefile.svg]; - [pandoc] for generating the documentation HTML and " -"website." -msgstr "" - -#. type: Plain text -#: index.en.md:103 -msgid "" -"[Valgrind]: https://valgrind.org [ShellCheck]: https://www.shellcheck.net/ " -"[po4a]: https://po4a.org/index.php.en [gettext]: " -"https://www.gnu.org/software/gettext/ [pandoc]: https://pandoc.org/ [mdpo]: " -"https://mdpo.readthedocs.io/en/master/ [makefile2graph]: " -"https://github.com/lindenb/makefile2graph [graphviz]: https://graphviz.org/ " -"[makefile.svg]: https://euandreh.xyz/git-permalink/makefile.svg" -msgstr "" - -#. type: Plain text -#: index.en.md:105 -msgid "For running the extra development-only checks, run:" -msgstr "" - -#. type: Plain text -#: index.en.md:109 -msgid "```shell $ make dev-check ```" -msgstr "" - -#. type: Plain text -#: index.en.md:111 -msgid "and for generating the documentation HTML and website, run:" -msgstr "" - -#. type: Plain text -#: index.en.md:115 -msgid "```shell $ make public ```" -msgstr "" - -#. type: Plain text -#: index.en.md:118 -msgid "" -"Send contributions to the [mailing list] via [`git " -"send-email`](https://git-send-email.io/)." -msgstr "" - -#. type: Plain text -#: index.en.md:121 -msgid "## Links" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -#, markdown-text -msgid "[homepage](https://euandre.org/s/remembering/en/)" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -#, markdown-text -msgid "[source code](https://euandre.org/git/remembering/)" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -#, markdown-text -msgid "[bug tracking](https://euandre.org/s/remembering/TODOs.html)" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -#, markdown-text -msgid "[mailing list]" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -#, markdown-text -msgid "[CI logs](https://euandre.org/s/remembering/ci/)" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:128 -#, markdown-text -msgid "[CHANGELOG](https://euandre.org/s/remembering/en/CHANGELOG.html)" -msgstr "" - -#. type: Plain text -#: index.en.md:130 -msgid "" -"[mailing list]: " -"https://lists.sr.ht/~euandreh/public-inbox?search=%5Bremembering%5D" -msgstr "" - -#. type: Plain text -#: index.en.md:133 -msgid "## Releases" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -#, markdown-text -msgid "" -"[v0.3.0](https://euandre.org/git/remembering/commit/?id=v0.3.0) " -"[remembering-v0.3.0.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-v0.3.0.tar.gz) " -"([sig](https://euandre.org/git/remembering/snapshot/remembering-v0.3.0.tar.gz.asc)) " -"- 2022-11-25" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -#, markdown-text -msgid "" -"[v0.2.1](https://euandre.org/git/remembering/commit/?id=v0.2.1) " -"[remembering-v0.2.1.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-v0.2.1.tar.gz) " -"([sig](https://euandre.org/git/remembering/snapshot/remembering-v0.2.1.tar.gz.asc)) " -"- 2021-02-23" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -#, markdown-text -msgid "" -"[v0.2.0](https://euandre.org/git/remembering/commit/?id=v0.2.0) " -"[remembering-v0.2.0.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-v0.2.0.tar.gz) " -"([sig](https://euandre.org/git/remembering/snapshot/remembering-v0.2.0.tar.gz.asc)) " -"- 2021-02-21" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -#, markdown-text -msgid "" -"[v0.1.2](https://euandre.org/git/remembering/commit/?id=v0.1.2) " -"[remembering-v0.1.2.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-v0.1.2.tar.gz) " -"([sig](https://euandre.org/git/remembering/snapshot/remembering-v0.1.2.tar.gz.asc)) " -"- 2021-01-26" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -#, markdown-text -msgid "" -"[v0.1.1](https://euandre.org/git/remembering/commit/?id=v0.1.1) " -"[remembering-v0.1.1.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-v0.1.1.tar.gz) " -"([sig](https://euandre.org/git/remembering/snapshot/remembering-v0.1.1.tar.gz.asc)) " -"- 2021-01-26" -msgstr "" - -#. type: Bullet: '- ' -#: index.en.md:140 -#, markdown-text -msgid "" -"[v0.1.0](https://euandre.org/git/remembering/commit/?id=v0.1.0) " -"[remembering-v0.1.0.tar.gz](https://euandre.org/git/remembering/snapshot/remembering-v0.1.0.tar.gz) " -"([sig](https://euandre.org/git/remembering/snapshot/remembering-v0.1.0.tar.gz.asc)) " -"- 2021-01-26" -msgstr "" - -#. type: Plain text -#: index.en.md:143 -msgid "## License" -msgstr "" - -#. type: Plain text -#: index.en.md:147 -msgid "" -"The code is licensed under [GNU Affero General Public License v3.0 or " -"later][AGPL-3.0-or-later] (AGPL-3.0-or-later)." -msgstr "" - -#. type: Plain text -#: index.en.md:148 -msgid "[AGPL-3.0-or-later]: https://euandre.org/git/remembering/tree/COPYING" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:11 -msgid "" -"<!-- Entry template: --> <!-- # Unreleased ## Added ## Changed ## Deprecated " -"## Removed ## Fixed ## Security -->" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:13 -msgid "Changelog for [remembering](https://euandre.org/remembering/en/)." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:16 -msgid "# Unreleased" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:19 -msgid "" -"# [0.3.0](https://euandre.org/git/remembering/commit/?id=v0.3.0) - " -"2022-11-25" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:21 CHANGELOG.en.md:99 CHANGELOG.en.md:124 -msgid "## Added" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:23 -msgid "### Inference of profiles" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:25 CHANGELOG.en.md:73 CHANGELOG.en.md:103 -msgid "## Changed" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:27 -msgid "### Remove `-c COMMAND` option" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:31 -msgid "" -"Instead of requiring a `-c COMMAND` option explicitly, instead receive the " -"commands to be ran as the \"rest\" argument to `remembering`, stored in " -"`$@`. The usage changes from:" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:35 -msgid "```shell $ remembering -p a-profile -c 'command $arg1 arg2' ```" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:37 -msgid "to:" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:41 -msgid "```shell $ remembering -p a-profile -- command $arg1 arg2 ```" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:51 -#, no-wrap -msgid "" -"The upsides are:\n" -"1. no need to worry about nested quotes: requiring a `-c COMMAND` option " -"forced\n" -" one to wrap the command and args inside quotes, and the quotation used\n" -" influenced the command to be ran;\n" -"1. one less option to know about: instead of having to remember what is " -"the\n" -" specific letter used for the command, just prefix the command with\n" -" `remembering`;\n" -"1. simpler and more powerful composition: wrapping commands without quoting " -"them\n" -" allows one to use many of such tools in combination:\n" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:55 -msgid "```shell $ time nice -n10 timeout 3 remembering sleep 5 ```" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:57 -#, no-wrap -msgid " The equivalent with `-c COMMAND` would be:\n" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:61 -msgid "" -"```shell $ time -c 'nice -n10 -c \"timeout 3 -c 'remembering -c \"sleep " -"5\"'\"' ```" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:64 -#, no-wrap -msgid "" -" But instead of alternating between single and double quotes, properly " -"quoting\n" -" them at each level.\n" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:66 CHANGELOG.en.md:110 CHANGELOG.en.md:117 -msgid "## Fixed" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:68 -msgid "### Improve speed" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:70 -msgid "Rewrite to make it faster" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:75 -msgid "### Use of `$XDG_DATA_HOME`" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:79 -msgid "" -"When the environment variable `$XDG_DATA_HOME` is defined, remembering now " -"appends a trailing `/remembering` to it instead of start writing files to " -"where the environment variable points to." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:81 -msgid "This is in conformance with the [XDG Base Directory Specification][xdg]." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:83 -msgid "" -"[xdg]: " -"https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:85 -msgid "### Exit code" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:87 -msgid "" -"When remembering encounters an unrecognized option, it now exits with 2 " -"instead of ignoring it." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:90 -msgid "" -"# [0.2.1](https://euandre.org/git/remembering/commit/?id=v0.2.1) - " -"2021-02-23" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:92 -msgid "## Removed" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:94 -msgid "Revert to plain `Makefile` over `./configure` + `Makefile.in`." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:97 -msgid "" -"# [0.2.0](https://euandre.org/git/remembering/commit/?id=v0.2.0) - " -"2021-02-21" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:101 -msgid "Add trivial `./configure` script." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:105 -msgid "Assume standard input is already sorted for faster processing." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:108 -msgid "" -"# [0.1.2](https://euandre.org/git/remembering/commit/?id=v0.1.2) - " -"2021-01-26" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:112 -msgid "Replace usage of GNU Coreutils' specific `tac` utility with `sed`." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:115 -msgid "" -"# [0.1.1](https://euandre.org/git/remembering/commit/?id=v0.1.1) - " -"2021-01-26" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:119 -msgid "Allow names with spaces." -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:122 -msgid "" -"# [0.1.0](https://euandre.org/git/remembering/commit/?id=v0.1.0) - " -"2021-01-26" -msgstr "" - -#. type: Plain text -#: CHANGELOG.en.md:125 -msgid "Initial public release." -msgstr "" - -#. type: Plain text -#: aux/checks/manpages/footer.en.0.in:2 -msgid ".SH AUTHORS" -msgstr "" - -#. type: Plain text -#: aux/checks/manpages/footer.en.0.in:7 -msgid ".MT eu@euandre.org EuAndreh .ME and contributors." -msgstr "" - -#. type: Plain text -#: aux/checks/manpages/footer.en.0.in:10 -msgid ".SH BUGS" -msgstr "" - -#. type: Plain text -#: aux/checks/manpages/footer.en.0.in:30 -msgid "" -".IP \\(bu Report bugs to the .MT ~euandreh/@MAILING_LIST@@lists.sr.ht " -"mailing list .ME . Use the subject \"\\f(CR[@NAME@] BUG or TASK: " -"<description>\\fR\". .IP \\(bu Browse bugs .UR " -"https://@DOMAIN@/@NAME@/TODOs.html online .UE . .IP \\(bu .UR " -"https://@DOMAIN@/@NAME@/en/ Homepage .UE . .IP \\(bu .UR " -"https://lists.sr.ht/~euandreh/@MAILING_LIST@?search=%5B@NAME@%5D Comments " -"and discussions .UE ." -msgstr "" diff --git a/repo.sh b/repo.sh deleted file mode 100755 index 7d81867..0000000 --- a/repo.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -set -eu - -f() { - set -e - bad-command - unreachable - return 0 -} - -f && echo 'Executed, but shoult not' - -if f; then - echo 'Also executed, but should not' -fi - -f || echo 'Not executed, but should be' - -if ! f; then - echo 'Also not executed, but should be' -fi - -set -x -set +e -f -STATUS=$? -set -e -if [ "$STATUS" != 0 ]; then - echo 'Only one that is executed when it should be' -fi - -f -echo 'This is *actually* unreachable' diff --git a/src/main.go b/src/main.go new file mode 100644 index 0000000..e462b0a --- /dev/null +++ b/src/main.go @@ -0,0 +1,7 @@ +package main + +import "remembering" + +func main() { + remembering.Main() +} diff --git a/src/remembering.go b/src/remembering.go new file mode 100644 index 0000000..8d2a017 --- /dev/null +++ b/src/remembering.go @@ -0,0 +1,331 @@ +package remembering + +import ( + "bytes" + "errors" + "flag" + "fmt" + "io" + "io/fs" + "os" + "os/exec" + "path/filepath" + "sort" + "strconv" + "strings" + "syscall" +) + + + +type envT struct { + allArgs []string + in io.Reader + out io.Writer + err io.Writer +} + +// entryT is one line of a profile file. Its on-disk form is +// "COUNT profile TEXT", and TEXT runs to the end of the line, so +// anything a menu can show --- spaces, UTF-8, leading blanks --- +// round-trips byte-for-byte. +type entryT struct { + count int + text string +} + + + +// splitLines turns raw input into menu lines: the final newline +// doesn't open a last empty line, but blank lines in the middle +// are kept, since a menu tool would show them. +func splitLines(data string) []string { + if data == "" { + return []string{} + } + return strings.Split(strings.TrimSuffix(data, "\n"), "\n") +} + +// parseProfile reads the on-disk "COUNT profile TEXT" lines. +// TEXT is recovered positionally, like the original awk substr() +// did, so blanks inside it survive. Lines without the "profile" +// tag are dropped; a non-numeric count reads as 0. +func parseProfile(content string) []entryT { + entries := []entryT{} + for _, line := range splitLines(content) { + fields := strings.Fields(line) + if len(fields) < 2 || fields[1] != "profile" { + continue + } + count, _ := strconv.Atoi(fields[0]) + idx := len(fields[0]) + len(fields[1]) + 2 + text := "" + if idx <= len(line) { + text = line[idx:] + } + entries = append(entries, entryT{count, text}) + } + return entries +} + +func serializeProfile(entries []entryT) string { + str := strings.Builder{} + for _, entry := range entries { + fmt.Fprintf( + &str, "%d profile %s\n", + entry.count, entry.text, + ) + } + return str.String() +} + +// menuFor ranks the stdin lines: most-picked first, ties in byte +// order, never-picked entries at the bottom. Counts of duplicate +// profile lines for the same text are summed. Only stdin defines +// what is offered --- profile entries absent from stdin are +// remembered, not shown. +func menuFor(profile []entryT, lines []string) []entryT { + counts := map[string]int{} + for _, entry := range profile { + counts[entry.text] += entry.count + } + + menu := make([]entryT, 0, len(lines)) + for _, line := range lines { + menu = append(menu, entryT{counts[line], line}) + } + sort.SliceStable(menu, func(i int, j int) bool { + if menu[i].count != menu[j].count { + return menu[i].count > menu[j].count + } + return menu[i].text < menu[j].text + }) + return menu +} + +func menuText(menu []entryT) string { + str := strings.Builder{} + for _, entry := range menu { + str.WriteString(entry.text) + str.WriteByte('\n') + } + return str.String() +} + +// nextProfile is the profile after choice was picked: the union +// of what the profile knew and what stdin offered, in byte order, +// with the pick's count bumped. A pick the profile has never +// seen is appended at the end, starting at 1; texts offered but +// never picked enter at 0, so the profile accumulates the +// universe of choices it has seen. Duplicate profile lines for +// the same text collapse to the highest count. +func nextProfile( + profile []entryT, + lines []string, + choice string, +) []entryT { + counts := map[string]int{} + for _, entry := range profile { + prev, seen := counts[entry.text] + if !seen || entry.count > prev { + counts[entry.text] = entry.count + } + } + for _, line := range lines { + _, seen := counts[line] + if !seen { + counts[line] = 0 + } + } + + texts := make([]string, 0, len(counts)) + for text := range counts { + texts = append(texts, text) + } + sort.Strings(texts) + + next := make([]entryT, 0, len(texts)+1) + found := false + for _, text := range texts { + count := counts[text] + if text == choice { + count++ + found = true + } + next = append(next, entryT{count, text}) + } + if !found { + next = append(next, entryT{1, choice}) + } + return next +} + + + +// profilePath is where a profile lives: +// $XDG_DATA_HOME/remembering/NAME, honouring the XDG default of +// ~/.local/share. The default profile name is the current +// directory with slashes turned into "!", so each directory gets +// its own ranking without any setup. +func profilePath(name string) (string, error) { + if name == "" { + cwd, err := os.Getwd() + if err != nil { + return "", err + } + name = strings.ReplaceAll(cwd, "/", "!") + } + data := os.Getenv("XDG_DATA_HOME") + if data == "" { + data = filepath.Join( + os.Getenv("HOME"), ".local", "share", + ) + } + return filepath.Join(data, Name, name), nil +} + +func exists(path string) bool { + _, err := os.Stat(path) + return err == nil +} + +// loadProfile reads the profile, creating an empty one (and its +// directory) on first use, so the file is in place even when this +// run ends up picking nothing. +func loadProfile(path string) ([]entryT, error) { + if !exists(path) { + err := os.MkdirAll(filepath.Dir(path), 0755) + if err != nil { + return nil, err + } + err = os.WriteFile(path, []byte{}, 0644) + if err != nil { + return nil, err + } + } + content, err := os.ReadFile(path) + if err != nil { + return nil, err + } + return parseProfile(string(content)), nil +} + +// saveProfile writes the new ranking atomically --- a sibling +// .tmp plus rename --- so a crash never leaves a half-written +// profile behind. +func saveProfile(path string, entries []entryT) error { + tmp := path + ".tmp" + err := os.WriteFile( + tmp, []byte(serializeProfile(entries)), 0644, + ) + if err != nil { + return err + } + return os.Rename(tmp, path) +} + +// forwardedStatus mirrors how sh(1) reports a child: its exit +// status as-is, or 128 plus the signal number when it was killed. +func forwardedStatus(err *exec.ExitError) int { + status, ok := err.Sys().(syscall.WaitStatus) + if ok && status.Signaled() { + return 128 + int(status.Signal()) + } + return err.ExitCode() +} + + + +func usage(w io.Writer) { + fmt.Fprintf( + w, + "Usage:\n %s [-p PROFILE] -- COMMAND...\n", + Name, + ) +} + +func run(env envT) int { + flags := flag.NewFlagSet("", flag.ContinueOnError) + flags.Usage = func() {} + flags.SetOutput(env.err) + profileName := flags.String("p", "", "") + + if flags.Parse(env.allArgs[1:]) != nil { + usage(env.err) + return 2 + } + + command := flags.Args() + if len(command) == 0 { + fmt.Fprintf(env.err, "Missing \"-- COMMAND\"\n") + usage(env.err) + return 2 + } + + path, err := profilePath(*profileName) + if err != nil { + fmt.Fprintf(env.err, "%s: %v\n", Name, err) + return 1 + } + profile, err := loadProfile(path) + if err != nil { + fmt.Fprintf(env.err, "%s: %v\n", Name, err) + return 1 + } + + stdin, err := io.ReadAll(env.in) + if err != nil { + fmt.Fprintf(env.err, "%s: %v\n", Name, err) + return 1 + } + lines := splitLines(string(stdin)) + + // the command is transparent in pipelines: its stderr is + // passed through (that's where dmenu and fzf draw), its + // stdout is the pick, and a nonzero exit --- a cancelled + // menu --- aborts the run with the same status, leaving the + // profile untouched + cmd := exec.Command(command[0], command[1:]...) + cmd.Stdin = strings.NewReader( + menuText(menuFor(profile, lines)), + ) + picked := bytes.Buffer{} + cmd.Stdout = &picked + cmd.Stderr = env.err + err = cmd.Run() + if err != nil { + exitErr := (*exec.ExitError)(nil) + if errors.As(err, &exitErr) { + return forwardedStatus(exitErr) + } + fmt.Fprintf(env.err, "%s: %v\n", Name, err) + if errors.Is(err, fs.ErrPermission) { + return 126 + } + return 127 + } + + choice := strings.TrimRight(picked.String(), "\n") + if choice == "" { + return 0 + } + + err = saveProfile(path, nextProfile(profile, lines, choice)) + if err != nil { + fmt.Fprintf(env.err, "%s: %v\n", Name, err) + return 1 + } + fmt.Fprintf(env.out, "%s\n", choice) + return 0 +} + + + +func Main() { + os.Exit(run(envT{ + allArgs: os.Args, + in: os.Stdin, + out: os.Stdout, + err: os.Stderr, + })) +} diff --git a/src/remembering.in b/src/remembering.in deleted file mode 100755 index 89e9453..0000000 --- a/src/remembering.in +++ /dev/null @@ -1,165 +0,0 @@ -#!/bin/sh -set -eu - - -usage() { - cat <<-'EOF' - Usage: - @NAME@ [-p PROFILE] -- COMMAND... - @NAME@ -h|-V - EOF -} - -help() { - cat <<-'EOF' - - Options: - -p PROFILE profile to be used for gathering and storing - data (default: create one based on $PWD) - -h, --help show this message - -V, --version print the version number - - COMMAND command to be ran, reading from - STDIN, writing to STDOUT - - - Explanation FIXME. - - See "man @NAME@" for more information. - - - Examples: - - FIXME: - - $ FIXME - EOF -} - -version() { - printf '%s %s %s\n' '@NAME@' '@VERSION@' '@DATE@' -} - - -uuid() { - od -xN20 /dev/urandom | - head -n1 | - awk '{OFS="-"; print $2$3,$4,$5,$6,$7$8$9}' -} - -tmpname() { - echo "${TMPDIR:-/tmp}/@NAME@.tmpfile.$(uuid)" -} - -mkstemp() { - name="$(tmpname)" - touch "$name" - echo "$name" -} - - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - --version) - version - exit - ;; - *) - ;; - esac -done - -PROFILE_NAME="$(pwd | tr '/' '!')" -while getopts 'p:hV' flag; do - case "$flag" in - p) - PROFILE_NAME="$OPTARG" - ;; - h) - usage - help - exit - ;; - V) - version - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - - -if [ $# = 0 ]; then - printf 'Missing "-- COMMAND"\n' >&2 - usage >&2 - exit 2 -fi - -NAME='@NAME@' -PROFILE="${XDG_DATA_HOME:-$HOME/.local/share}"/$NAME/"$PROFILE_NAME" - -if [ ! -e "$PROFILE" ]; then - mkdir -p "$(dirname "$PROFILE")" - touch "$PROFILE" -fi - -NEXT_PROFILE="$PROFILE".tmp -MERGED="$(mkstemp)" -FILTERED="$(mkstemp)" -trap 'rm -f "$NEXT_PROFILE" "$MERGED" "$FILTERED"' EXIT -CHOICE="$( - cat - | - sed 's/^/0 stdin /' | - sort -k3 -k1nr - "$PROFILE" | - tee "$MERGED" | - awk ' - { rest = substr($0, 3 + length($1) + length($2)) } - $2 == "profile" { seen[rest] += $1 } - $2 == "stdin" { printf "%s %s\n", seen[rest]+0, rest } - ' | - sort -k1nr | - cut -d' ' -f2- | - "$@" -)" - -if [ -z "$CHOICE" ]; then - exit -fi - -< "$MERGED" \ - cut -d' ' -f1,3- | - uniq -f1 | - awk -vCHOICE="$CHOICE" ' - BEGIN { inc = 1 } - - { rest = substr($0, 2 + length($1)) } - - rest == CHOICE { - printf "%s profile %s\n", $1 + inc, rest - found = 1 - next - } - - { printf "%s profile %s\n", $1, rest } - - END { - if (!found) { - printf "%s profile %s\n", 0 + inc, CHOICE - } - } - ' > "$NEXT_PROFILE" - -mv "$NEXT_PROFILE" "$PROFILE" -printf '%s\n' "$CHOICE" diff --git a/tests/benchmarks/ranking-throughput/main.go b/tests/benchmarks/ranking-throughput/main.go new file mode 100644 index 0000000..0b02dc7 --- /dev/null +++ b/tests/benchmarks/ranking-throughput/main.go @@ -0,0 +1,7 @@ +package main + +import "remembering" + +func main() { + remembering.MainTest() +} diff --git a/tests/benchmarks/ranking-throughput/remembering.go b/tests/benchmarks/ranking-throughput/remembering.go new file mode 100644 index 0000000..041eaeb --- /dev/null +++ b/tests/benchmarks/ranking-throughput/remembering.go @@ -0,0 +1,76 @@ +package remembering + +import ( + "flag" + "fmt" + "io" + "os" + "path/filepath" + "strings" +) + + + +var linesFlag = flag.Int( + "lines", + 1000000, + "The number of menu lines to rank", +) + +func MainTest() { + flag.Parse() + n := *linesFlag + + tmp, err := os.MkdirTemp("", "remembering-bench-") + if err != nil { + panic(err) + } + defer os.RemoveAll(tmp) + err = os.Setenv("XDG_DATA_HOME", tmp) + if err != nil { + panic(err) + } + + menu := strings.Builder{} + for i := 0; i < n; i++ { + fmt.Fprintf(&menu, "item-%07d\n", i) + } + + // half the items are already known, with spread counts + profile := strings.Builder{} + for i := 0; i < n; i += 2 { + fmt.Fprintf( + &profile, "%d profile item-%07d\n", + i%97, i, + ) + } + path, err := profilePath("bench") + if err != nil { + panic(err) + } + err = os.MkdirAll(filepath.Dir(path), 0755) + if err != nil { + panic(err) + } + err = os.WriteFile( + path, []byte(profile.String()), 0644, + ) + if err != nil { + panic(err) + } + + rc := run(envT{ + allArgs: []string{ + "remembering", "-p", "bench", + "--", "tail", "-n1", + }, + in: strings.NewReader(menu.String()), + out: io.Discard, + err: os.Stderr, + }) + if rc != 0 { + panic("ranking failed") + } + + fmt.Printf("ranked %d lines\n", n) +} diff --git a/tests/cli-opts.sh b/tests/cli-opts.sh index 83a5bfc..0ce4eef 100755 --- a/tests/cli-opts.sh +++ b/tests/cli-opts.sh @@ -3,6 +3,8 @@ set -u . tests/lib.sh +REMEMBERING="$PWD/remembering.bin" + export XDG_DATA_HOME="$PWD/tests/test-profiles" test_unsupported_long_flags() { @@ -10,32 +12,40 @@ test_unsupported_long_flags() { N="$LINENO" OUT="$(mkstemp)" ERR="$(mkstemp)" - ./src/remembering --unknown-long-flag 1>"$OUT" 2>"$ERR" + "$REMEMBERING" --unknown-long-flag 1>"$OUT" 2>"$ERR" STATUS=$? assert_status 2 assert_usage "$ERR" test_ok } -test_missing_required_flags() { - testing 'missing required flags' +test_unknown_flags() { + testing 'unknown flags' N="$LINENO" OUT="$(mkstemp)" ERR="$(mkstemp)" - ./src/remembering -a something -b else 1>"$OUT" 2>"$ERR" + "$REMEMBERING" -a something -b else 1>"$OUT" 2>"$ERR" STATUS=$? assert_status 2 assert_usage "$ERR" test_ok } -test_single_required_flag() { - testing 'single required flag' +test_missing_command() { + testing 'missing command' + + N="$LINENO" + OUT="$(mkstemp)" + ERR="$(mkstemp)" + "$REMEMBERING" 1>"$OUT" 2>"$ERR" + STATUS=$? + assert_status 2 + assert_usage "$ERR" N="$LINENO" OUT="$(mkstemp)" ERR="$(mkstemp)" - ./src/remembering -p valid-test-profile 1>"$OUT" 2>"$ERR" + "$REMEMBERING" -p valid-test-profile 1>"$OUT" 2>"$ERR" STATUS=$? assert_status 2 assert_usage "$ERR" @@ -43,7 +53,7 @@ test_single_required_flag() { N="$LINENO" OUT="$(mkstemp)" ERR="$(mkstemp)" - ./src/remembering -c 'head -n' 1>"$OUT" 2>"$ERR" + "$REMEMBERING" -c 'head -n' 1>"$OUT" 2>"$ERR" STATUS=$? assert_status 2 assert_usage "$ERR" @@ -57,7 +67,7 @@ test_flags_without_required_argument() { N="$LINENO" OUT="$(mkstemp)" ERR="$(mkstemp)" - ./src/remembering -pc 1>"$OUT" 2>"$ERR" + "$REMEMBERING" -pc 1>"$OUT" 2>"$ERR" STATUS=$? assert_status 2 assert_usage "$ERR" @@ -65,7 +75,7 @@ test_flags_without_required_argument() { N="$LINENO" OUT="$(mkstemp)" ERR="$(mkstemp)" - ./src/remembering -cp 1>"$OUT" 2>"$ERR" + "$REMEMBERING" -cp 1>"$OUT" 2>"$ERR" STATUS=$? assert_status 2 assert_usage "$ERR" @@ -73,7 +83,7 @@ test_flags_without_required_argument() { N="$LINENO" OUT="$(mkstemp)" ERR="$(mkstemp)" - ./src/remembering -p -c 1>"$OUT" 2>"$ERR" + "$REMEMBERING" -p -c 1>"$OUT" 2>"$ERR" STATUS=$? assert_status 2 assert_usage "$ERR" @@ -87,7 +97,7 @@ test_valid_options() { OUT="$(mkstemp)" ERR="$(mkstemp)" printf 'a\nb\nc\n' | \ - ./src/remembering \ + "$REMEMBERING" \ -p "always-unique-$(uuid)" \ -- head -n1 \ 1>"$OUT" 2>"$ERR" @@ -98,69 +108,68 @@ test_valid_options() { test_ok } -test_help_flags() { - testing 'help flags' +test_rejected_help_flags() { + testing 'help flags are rejected' N="$LINENO" OUT="$(mkstemp)" ERR="$(mkstemp)" - ./src/remembering -h 1>"$OUT" 2>"$ERR" + "$REMEMBERING" -h 1>"$OUT" 2>"$ERR" STATUS=$? - assert_status 0 - assert_empty_stderr - assert_usage "$OUT" + assert_status 2 + assert_empty_stdout + assert_usage "$ERR" N="$LINENO" OUT="$(mkstemp)" ERR="$(mkstemp)" - ./src/remembering --help 1>"$OUT" 2>"$ERR" + "$REMEMBERING" --help 1>"$OUT" 2>"$ERR" STATUS=$? - assert_status 0 - assert_empty_stderr - assert_usage "$OUT" + assert_status 2 + assert_empty_stdout + assert_usage "$ERR" N="$LINENO" OUT="$(mkstemp)" ERR="$(mkstemp)" - ./src/remembering -p profile -c command --help 1>"$OUT" 2>"$ERR" + "$REMEMBERING" -p profile --help -- head -n1 1>"$OUT" 2>"$ERR" STATUS=$? - assert_status 0 - assert_empty_stderr - assert_usage "$OUT" + assert_status 2 + assert_empty_stdout + assert_usage "$ERR" N="$LINENO" OUT="$(mkstemp)" ERR="$(mkstemp)" - ./src/remembering --help -p profile -c command 1>"$OUT" 2>"$ERR" + "$REMEMBERING" --help -p profile -- head -n1 1>"$OUT" 2>"$ERR" STATUS=$? - assert_status 0 - assert_empty_stderr - assert_usage "$OUT" + assert_status 2 + assert_empty_stdout + assert_usage "$ERR" test_ok } -test_version_flags() { - testing 'version flags' - REGEX='^remembering [0-9\.]+ [0-9-]+$' +test_rejected_version_flags() { + testing 'version flags are rejected' N="$LINENO" OUT="$(mkstemp)" ERR="$(mkstemp)" - ./src/remembering -V 1>"$OUT" 2>"$ERR" + "$REMEMBERING" -V 1>"$OUT" 2>"$ERR" STATUS=$? - assert_status 0 - assert_empty_stderr - assert_grep_stdout "$REGEX" + assert_status 2 + assert_empty_stdout + assert_usage "$ERR" N="$LINENO" OUT="$(mkstemp)" ERR="$(mkstemp)" - ./src/remembering --version 1>"$OUT" 2>"$ERR" + "$REMEMBERING" --version 1>"$OUT" 2>"$ERR" STATUS=$? - assert_status 0 - assert_empty_stderr - assert_grep_stdout "$REGEX" + assert_status 2 + assert_empty_stdout + assert_usage "$ERR" test_ok } @@ -174,7 +183,7 @@ test_environment_variables_and_precedence() { PROFILE='environment-variables-xdg' XDG="$PWD/tests/test-profiles/xdg-test-$(uuid)" printf 'a\n' | \ - XDG_DATA_HOME="$XDG" ./src/remembering \ + XDG_DATA_HOME="$XDG" "$REMEMBERING" \ -p "$PROFILE" \ -- head -n1 \ 1>"$OUT" 2>"$ERR" @@ -190,7 +199,7 @@ test_environment_variables_and_precedence() { PROFILE='environment-variables-home' HHOME="$PWD/tests/test-profiles/home-test-$(uuid)" printf 'b\n' | \ - HOME="$HHOME" XDG_DATA_HOME='' ./src/remembering \ + HOME="$HHOME" XDG_DATA_HOME='' "$REMEMBERING" \ -p "$PROFILE" \ -- head -n1 \ 1>"$OUT" 2>"$ERR" @@ -207,7 +216,7 @@ test_environment_variables_and_precedence() { HHOME="$PWD/tests/test-profiles/home-wins-over-xdg-test-$(uuid)" XDG="$PWD/tests/test-profiles/xdg-wins-over-home-test-$(uuid)" printf 'c\n' | \ - HOME="$HHOME" XDG_DATA_HOME="$XDG" ./src/remembering \ + HOME="$HHOME" XDG_DATA_HOME="$XDG" "$REMEMBERING" \ -p "$PROFILE" \ -- head -n1 \ 1>"$OUT" 2>"$ERR" @@ -227,11 +236,10 @@ test_environment_variables_and_precedence() { } test_unsupported_long_flags -test_missing_required_flags -test_missing_required_flags -test_single_required_flag +test_unknown_flags +test_missing_command test_flags_without_required_argument test_valid_options -test_help_flags -test_version_flags +test_rejected_help_flags +test_rejected_version_flags test_environment_variables_and_precedence diff --git a/tests/functional/pick-roundtrip/main.go b/tests/functional/pick-roundtrip/main.go new file mode 100644 index 0000000..0b02dc7 --- /dev/null +++ b/tests/functional/pick-roundtrip/main.go @@ -0,0 +1,7 @@ +package main + +import "remembering" + +func main() { + remembering.MainTest() +} diff --git a/tests/functional/pick-roundtrip/remembering.go b/tests/functional/pick-roundtrip/remembering.go new file mode 100644 index 0000000..e2d54da --- /dev/null +++ b/tests/functional/pick-roundtrip/remembering.go @@ -0,0 +1,129 @@ +package remembering + +import ( + "fmt" + "os" + "reflect" + "strings" +) + + + +func showColour() bool { + return os.Getenv("NO_COLOUR") == "" +} + +func testing(message string, body func()) { + if showColour() { + fmt.Fprintf( + os.Stderr, + "\033[0;33mtesting\033[0m: %s... ", + message, + ) + body() + fmt.Fprintf(os.Stderr, "\033[0;32mOK\033[0m.\n") + } else { + fmt.Fprintf(os.Stderr, "testing: %s... ", message) + body() + fmt.Fprintf(os.Stderr, "OK.\n") + } +} + +func assertEq(given any, expected any) { + if !reflect.DeepEqual(given, expected) { + if showColour() { + fmt.Fprintf(os.Stderr, "\033[0;31mERR\033[0m.\n") + } else { + fmt.Fprintf(os.Stderr, "ERR.\n") + } + fmt.Fprintf(os.Stderr, "given != expected\n") + fmt.Fprintf(os.Stderr, "given: %#v\n", given) + fmt.Fprintf(os.Stderr, "expected: %#v\n", expected) + os.Exit(1) + } +} + + + +func pick(menu string, command ...string) (int, string, string) { + out := strings.Builder{} + errW := strings.Builder{} + rc := run(envT{ + allArgs: append( + []string{"remembering", "-p", "func", "--"}, + command..., + ), + in: strings.NewReader(menu), + out: &out, + err: &errW, + }) + return rc, out.String(), errW.String() +} + +func profileBytes() string { + path, err := profilePath("func") + if err != nil { + panic(err) + } + data, err := os.ReadFile(path) + if err != nil { + panic(err) + } + return string(data) +} + + + +func MainTest() { + testing("a session of picks shapes the ranking", func() { + tmp, err := os.MkdirTemp( + "", "remembering-functional-", + ) + assertEq(err, nil) + defer os.RemoveAll(tmp) + saved := os.Getenv("XDG_DATA_HOME") + os.Setenv("XDG_DATA_HOME", tmp) + defer os.Setenv("XDG_DATA_HOME", saved) + + menu := "a\nb\nc\nd\ne\n" + + rc, out, errW := pick(menu, "grep", "-F", "c") + assertEq(rc, 0) + assertEq(out, "c\n") + assertEq(errW, "") + assertEq( + profileBytes(), + "0 profile a\n"+ + "0 profile b\n"+ + "1 profile c\n"+ + "0 profile d\n"+ + "0 profile e\n", + ) + + // the learnt pick now ranks first + rc, out, errW = pick(menu, "head", "-n1") + assertEq(rc, 0) + assertEq(out, "c\n") + assertEq(errW, "") + assertEq( + profileBytes(), + "0 profile a\n"+ + "0 profile b\n"+ + "2 profile c\n"+ + "0 profile d\n"+ + "0 profile e\n", + ) + + // a cancelled menu forwards the status and + // learns nothing + rc, out, _ = pick(menu, "sh", "-c", "exit 3") + assertEq(rc, 3) + assertEq(out, "") + assertEq( + strings.Contains( + profileBytes(), "2 profile c", + ), + true, + ) + }) +} diff --git a/tests/fuzz/profile/main.go b/tests/fuzz/profile/main.go new file mode 100644 index 0000000..0b02dc7 --- /dev/null +++ b/tests/fuzz/profile/main.go @@ -0,0 +1,7 @@ +package main + +import "remembering" + +func main() { + remembering.MainTest() +} diff --git a/tests/fuzz/profile/remembering.go b/tests/fuzz/profile/remembering.go new file mode 100644 index 0000000..aab4ac4 --- /dev/null +++ b/tests/fuzz/profile/remembering.go @@ -0,0 +1,76 @@ +package remembering + +import ( + "os" + "reflect" + "strings" + "testing" + "testing/internal/testdeps" +) + + + +func fn(f *testing.F) { + f.Add("0 profile a\n1 profile b\n", "c\nd", "a") + f.Add("", "x", "x") + f.Fuzz(func( + t *testing.T, + content string, + input string, + choice string, + ) { + profile := parseProfile(content) + again := parseProfile(serializeProfile(profile)) + if !reflect.DeepEqual(again, profile) { + t.Fatalf( + "roundtrip: %#v != %#v", + again, profile, + ) + } + + if choice == "" || + strings.Contains(choice, "\n") { + return + } + lines := splitLines(input) + next := nextProfile(profile, lines, choice) + + found := false + for _, entry := range next { + if entry.text == choice { + found = true + } + } + if !found { + t.Fatalf( + "pick %q not learnt in %#v", + choice, next, + ) + } + + reNext := parseProfile(serializeProfile(next)) + if !reflect.DeepEqual(reNext, next) { + t.Fatalf( + "next roundtrip: %#v != %#v", + reNext, next, + ) + } + }) +} + + + +func MainTest() { + fuzzTargets := []testing.InternalFuzzTarget{ + {"fn", fn}, + } + + deps := testdeps.TestDeps{} + tests := []testing.InternalTest {} + benchmarks := []testing.InternalBenchmark{} + examples := []testing.InternalExample {} + m := testing.MainStart( + deps, tests, benchmarks, fuzzTargets, examples, + ) + os.Exit(m.Run()) +} diff --git a/tests/main.go b/tests/main.go new file mode 100644 index 0000000..0b02dc7 --- /dev/null +++ b/tests/main.go @@ -0,0 +1,7 @@ +package main + +import "remembering" + +func main() { + remembering.MainTest() +} diff --git a/tests/ranking.sh b/tests/ranking.sh index af26c94..45cb0ec 100755 --- a/tests/ranking.sh +++ b/tests/ranking.sh @@ -3,6 +3,8 @@ set -eu . tests/lib.sh +REMEMBERING="$PWD/remembering.bin" + export XDG_DATA_HOME="$PWD/tests/test-profiles" export LANG=C.UTF-8 @@ -38,7 +40,7 @@ pick_x() { PICK="$1" echo "${2:-$INPUT}" | \ - ./src/remembering \ + "$REMEMBERING" \ -p "$PROFILE" \ -- sh -c "tee -a /dev/stderr | grep -F \"$PICK\"" \ 1>"$OUT" 2>"$ERR" @@ -83,7 +85,7 @@ test_picking_first_makes_it_be_always_first() { PROFILE="always-picks-first-$(uuid)" for _ in $(seq 10); do printf 'always-picked\nnever-picked\n' | \ - ./src/remembering \ + "$REMEMBERING" \ -p "$PROFILE" \ -- head -n1 \ 1>"$OUT" 2>"$ERR" @@ -203,7 +205,7 @@ d e' echo "$INPUT" | \ - ./src/remembering \ + "$REMEMBERING" \ -p "$PROFILE" \ -- echo f \ 1>"$OUT" 2>"$ERR" @@ -277,7 +279,7 @@ test_stdin_is_empty() { ERR="$(mkstemp)" printf '' | \ - ./src/remembering \ + "$REMEMBERING" \ -p "$PROFILE" \ -- sh -c 'tee -a /dev/stderr | head -n1' \ 1>"$OUT" 2>"$ERR" @@ -340,7 +342,7 @@ test_really_long_list() { PROFILE="really-long-list-$(uuid)" N=999999 seq "$N" | \ - ./src/remembering \ + "$REMEMBERING" \ -p "$PROFILE" \ -- tail -n1 \ 1>"$OUT" 2>"$ERR" diff --git a/tests/remembering.go b/tests/remembering.go new file mode 100644 index 0000000..3f8e446 --- /dev/null +++ b/tests/remembering.go @@ -0,0 +1,523 @@ +package remembering + +import ( + "fmt" + "os" + "path/filepath" + "reflect" + "strings" +) + + + +func showColour() bool { + return os.Getenv("NO_COLOUR") == "" +} + +func testStart(name string) { + fmt.Fprintf(os.Stderr, "%s:\n", name) +} + +func testing(message string, body func()) { + if showColour() { + fmt.Fprintf( + os.Stderr, + "\033[0;33mtesting\033[0m: %s... ", + message, + ) + body() + fmt.Fprintf(os.Stderr, "\033[0;32mOK\033[0m.\n") + } else { + fmt.Fprintf(os.Stderr, "testing: %s... ", message) + body() + fmt.Fprintf(os.Stderr, "OK.\n") + } +} + +func assertEq(given any, expected any) { + if !reflect.DeepEqual(given, expected) { + if showColour() { + fmt.Fprintf(os.Stderr, "\033[0;31mERR\033[0m.\n") + } else { + fmt.Fprintf(os.Stderr, "ERR.\n") + } + fmt.Fprintf(os.Stderr, "given != expected\n") + fmt.Fprintf(os.Stderr, "given: %#v\n", given) + fmt.Fprintf(os.Stderr, "expected: %#v\n", expected) + os.Exit(1) + } +} + + + +func mktmp() string { + dir, err := os.MkdirTemp("", "remembering-tests-") + if err != nil { + panic(err) + } + return dir +} + +func withEnv(key string, value string, body func()) { + saved, had := os.LookupEnv(key) + os.Setenv(key, value) + defer func() { + if had { + os.Setenv(key, saved) + } else { + os.Unsetenv(key) + } + }() + body() +} + +func runWith(stdin string, args ...string) (int, string, string) { + out := strings.Builder{} + errW := strings.Builder{} + rc := run(envT{ + allArgs: append([]string{"remembering"}, args...), + in: strings.NewReader(stdin), + out: &out, + err: &errW, + }) + return rc, out.String(), errW.String() +} + +func seedProfile(name string, content string) { + path, err := profilePath(name) + if err != nil { + panic(err) + } + err = os.MkdirAll(filepath.Dir(path), 0755) + if err != nil { + panic(err) + } + err = os.WriteFile(path, []byte(content), 0644) + if err != nil { + panic(err) + } +} + +func profileContent(name string) string { + path, err := profilePath(name) + if err != nil { + panic(err) + } + data, err := os.ReadFile(path) + if err != nil { + panic(err) + } + return string(data) +} + + + +func test_splitLines() { + testStart("splitLines()") + + testing("empty input has no lines", func() { + assertEq(splitLines(""), []string{}) + }) + + testing("the final newline opens no empty line", func() { + assertEq(splitLines("a\nb\n"), []string{"a", "b"}) + }) + + testing("a missing final newline still ends a line", func() { + assertEq(splitLines("a\nb"), []string{"a", "b"}) + }) + + testing("blank lines in the middle are kept", func() { + assertEq( + splitLines("a\n\nb\n"), + []string{"a", "", "b"}, + ) + }) + + testing("a lone newline is one empty line", func() { + assertEq(splitLines("\n"), []string{""}) + }) +} + +func test_parseProfile() { + testStart("parseProfile()") + + testing("canonical lines", func() { + assertEq( + parseProfile("0 profile a\n12 profile b c\n"), + []entryT{{0, "a"}, {12, "b c"}}, + ) + }) + + testing("text keeps its leading blanks", func() { + assertEq( + parseProfile("1 profile spaced\n"), + []entryT{{1, " spaced"}}, + ) + }) + + testing("untagged and blank lines are dropped", func() { + given := parseProfile( + "1 stdin a\njunk\n\n2 profile b\n", + ) + assertEq(given, []entryT{{2, "b"}}) + }) + + testing("a non-numeric count reads as zero", func() { + assertEq( + parseProfile("x profile a\n"), + []entryT{{0, "a"}}, + ) + }) + + testing("duplicate texts are kept apart", func() { + assertEq( + parseProfile("3 profile a\n2 profile a\n"), + []entryT{{3, "a"}, {2, "a"}}, + ) + }) +} + +func test_serializeProfile() { + testStart("serializeProfile()") + + testing("one line per entry, count first", func() { + given := serializeProfile([]entryT{ + {1, "a b"}, + {0, "c"}, + }) + assertEq(given, "1 profile a b\n0 profile c\n") + }) + + testing("no entries make an empty file", func() { + assertEq(serializeProfile([]entryT{}), "") + }) + + testing("parse undoes serialize", func() { + entries := []entryT{{4, " x"}, {0, "y z"}} + assertEq( + parseProfile(serializeProfile(entries)), + entries, + ) + }) +} + +func test_menuFor() { + testStart("menuFor()") + + testing("most picked first, ties in byte order", func() { + profile := []entryT{ + {4, "l"}, {3, "f"}, {2, "a"}, {2, "g"}, + {2, "r"}, {1, "b"}, {1, "d"}, {1, "m"}, + {1, "s"}, + } + lines := []string{ + "a", "b", "c", "d", "f", + "g", "l", "m", "r", "s", + } + assertEq(menuFor(profile, lines), []entryT{ + {4, "l"}, {3, "f"}, {2, "a"}, {2, "g"}, + {2, "r"}, {1, "b"}, {1, "d"}, {1, "m"}, + {1, "s"}, {0, "c"}, + }) + }) + + testing("duplicate profile counts are summed", func() { + profile := []entryT{{2, "x"}, {3, "x"}} + given := menuFor(profile, []string{"x", "y"}) + assertEq(given, []entryT{{5, "x"}, {0, "y"}}) + }) + + testing("duplicate stdin lines all appear", func() { + given := menuFor([]entryT{}, []string{"x", "x"}) + assertEq(given, []entryT{{0, "x"}, {0, "x"}}) + }) + + testing("byte order, not collation order", func() { + given := menuFor([]entryT{}, []string{"é", "e"}) + assertEq(given, []entryT{{0, "e"}, {0, "é"}}) + }) + + testing("stdin defines the menu", func() { + profile := []entryT{{9, "ghost"}} + given := menuFor(profile, []string{"a"}) + assertEq(given, []entryT{{0, "a"}}) + }) +} + +func test_menuText() { + testStart("menuText()") + + testing("texts, one per line", func() { + menu := []entryT{{1, "a"}, {0, "b c"}} + assertEq(menuText(menu), "a\nb c\n") + }) + + testing("an empty menu is empty input", func() { + assertEq(menuText([]entryT{}), "") + }) +} + +func test_nextProfile() { + testStart("nextProfile()") + + zeroes := []entryT{ + {0, "a"}, {0, "b"}, {0, "c"}, {0, "d"}, {0, "e"}, + } + lines := []string{"a", "b", "c", "d", "e"} + + testing("the pick's count is bumped", func() { + assertEq(nextProfile(zeroes, lines, "a"), []entryT{ + {1, "a"}, {0, "b"}, {0, "c"}, + {0, "d"}, {0, "e"}, + }) + }) + + testing("an unknown pick is appended at the end", func() { + assertEq(nextProfile(zeroes, lines, "f"), []entryT{ + {0, "a"}, {0, "b"}, {0, "c"}, + {0, "d"}, {0, "e"}, {1, "f"}, + }) + }) + + testing("offered but never picked enters at zero", func() { + given := nextProfile( + []entryT{{0, "a"}}, lines, "a", + ) + assertEq(given, []entryT{ + {1, "a"}, {0, "b"}, {0, "c"}, + {0, "d"}, {0, "e"}, + }) + }) + + testing("entries absent from stdin are retained", func() { + profile := []entryT{{0, "a"}, {7, "z"}} + given := nextProfile( + profile, []string{"a", "b"}, "a", + ) + assertEq(given, []entryT{ + {1, "a"}, {0, "b"}, {7, "z"}, + }) + }) + + testing("duplicate texts collapse to the highest", func() { + profile := []entryT{{2, "x"}, {5, "x"}} + given := nextProfile(profile, []string{}, "x") + assertEq(given, []entryT{{6, "x"}}) + }) + + testing("picking twice accumulates", func() { + once := nextProfile([]entryT{}, lines, "c") + twice := nextProfile(once, lines, "c") + assertEq(twice, []entryT{ + {0, "a"}, {0, "b"}, {2, "c"}, + {0, "d"}, {0, "e"}, + }) + }) +} + +func test_profilePath() { + testStart("profilePath()") + + testing("$XDG_DATA_HOME wins", func() { + withEnv("XDG_DATA_HOME", "/x", func() { + withEnv("HOME", "/h", func() { + given, err := profilePath("name") + assertEq(err, nil) + assertEq( + given, + "/x/remembering/name", + ) + }) + }) + }) + + testing("an empty $XDG_DATA_HOME falls back", func() { + withEnv("XDG_DATA_HOME", "", func() { + withEnv("HOME", "/h", func() { + given, err := profilePath("name") + assertEq(err, nil) + assertEq( + given, + "/h/.local/share/"+ + "remembering/name", + ) + }) + }) + }) + + testing("the default name is the cwd, bashed", func() { + withEnv("XDG_DATA_HOME", "/x", func() { + cwd, err := os.Getwd() + assertEq(err, nil) + expected := filepath.Join( + "/x", Name, + strings.ReplaceAll(cwd, "/", "!"), + ) + given, err := profilePath("") + assertEq(err, nil) + assertEq(given, expected) + }) + }) +} + +func test_run_usage() { + testStart("run() usage") + + testing("a missing COMMAND is a usage error", func() { + rc, out, errW := runWith("") + assertEq(rc, 2) + assertEq(out, "") + assertEq( + strings.Contains( + errW, "Missing \"-- COMMAND\"", + ), + true, + ) + assertEq(strings.Contains(errW, "Usage:"), true) + }) + + testing("an unknown flag is a usage error", func() { + rc, _, errW := runWith("", "-x", "--", "head") + assertEq(rc, 2) + assertEq(strings.Contains(errW, "Usage:"), true) + }) + + testing("long options are rejected", func() { + rc, _, errW := runWith("", "--help") + assertEq(rc, 2) + assertEq(strings.Contains(errW, "Usage:"), true) + }) + + testing("-p alone still misses COMMAND", func() { + rc, _, errW := runWith("", "-p", "x") + assertEq(rc, 2) + assertEq(strings.Contains(errW, "Usage:"), true) + }) +} + +func test_run_flow() { + testStart("run() flow") + + tmp := mktmp() + defer os.RemoveAll(tmp) + + withEnv("XDG_DATA_HOME", tmp, func() { + testing("a pick is learnt, printed", func() { + rc, out, errW := runWith( + "b\na\n", + "-p", "t1", "--", "head", "-n1", + ) + assertEq(rc, 0) + assertEq(out, "a\n") + assertEq(errW, "") + assertEq( + profileContent("t1"), + "1 profile a\n0 profile b\n", + ) + }) + + testing("a second pick ranks above", func() { + rc, out, _ := runWith( + "b\na\n", + "-p", "t1", "--", "head", "-n1", + ) + assertEq(rc, 0) + assertEq(out, "a\n") + assertEq( + profileContent("t1"), + "2 profile a\n0 profile b\n", + ) + }) + + testing("no pick leaves the profile alone", func() { + rc, out, errW := runWith( + "", + "-p", "t2", "--", "head", "-n1", + ) + assertEq(rc, 0) + assertEq(out, "") + assertEq(errW, "") + assertEq(profileContent("t2"), "") + }) + + testing("an unknown pick is appended", func() { + seedProfile( + "t3", + "0 profile a\n0 profile b\n", + ) + rc, out, _ := runWith( + "a\nb\n", + "-p", "t3", "--", + "sh", "-c", "echo q", + ) + assertEq(rc, 0) + assertEq(out, "q\n") + assertEq( + profileContent("t3"), + "0 profile a\n0 profile b\n"+ + "1 profile q\n", + ) + }) + + testing("the command status is forwarded", func() { + rc, out, _ := runWith( + "", + "-p", "t4", "--", + "sh", "-c", "exit 7", + ) + assertEq(rc, 7) + assertEq(out, "") + }) + + testing("a signal death is 128 plus it", func() { + rc, _, _ := runWith( + "", + "-p", "t5", "--", + "sh", "-c", "kill -9 $$", + ) + assertEq(rc, 137) + }) + + testing("a missing command is 127", func() { + rc, _, errW := runWith( + "", + "-p", "t6", "--", + "/nonexistent-remembering-x", + ) + assertEq(rc, 127) + assertEq( + strings.Contains( + errW, "remembering:", + ), + true, + ) + }) + + testing("the command stderr passes through", func() { + rc, out, errW := runWith( + "x\n", + "-p", "t7", "--", + "sh", "-c", + "echo warn >&2; head -n1", + ) + assertEq(rc, 0) + assertEq(out, "x\n") + assertEq(errW, "warn\n") + }) + }) +} + + + +func MainTest() { + test_splitLines() + test_parseProfile() + test_serializeProfile() + test_menuFor() + test_menuText() + test_nextProfile() + test_profilePath() + test_run_usage() + test_run_flow() +} diff --git a/tests/signals.sh b/tests/signals.sh index 36491cf..e1cb063 100755 --- a/tests/signals.sh +++ b/tests/signals.sh @@ -3,6 +3,8 @@ set -u . tests/lib.sh +REMEMBERING="$PWD/remembering.bin" + XDG_DATA_HOME="$PWD/tests/test-profiles/signals-$(uuid)" export XDG_DATA_HOME @@ -10,15 +12,15 @@ test_status_is_zero_when_command_is_successful() { testing 'status is 0 when command is successful' N="$LINENO" - printf 'a\n' | ./src/remembering -pp1 -- head -n1 1>/dev/null 2>/dev/null + printf 'a\n' | "$REMEMBERING" -p p1 -- head -n1 1>/dev/null 2>/dev/null STATUS=$? assert_status 0 - printf '' | ./src/remembering -pp2 -- true 1>/dev/null 2>/dev/null + printf '' | "$REMEMBERING" -p p2 -- true 1>/dev/null 2>/dev/null STATUS=$? assert_status 0 - seq 9 | ./src/remembering -pp3 -- grep 7 1>/dev/null 2>/dev/null + seq 9 | "$REMEMBERING" -p p3 -- grep 7 1>/dev/null 2>/dev/null STATUS=$? assert_status 0 @@ -29,7 +31,7 @@ test_status_is_forwarded_from_command() { testing 'status is forwarded from command' N="$LINENO" for status in $(seq 1 125); do - printf '' | ./src/remembering -pp4 -- sh -c "exit $status" 1>/dev/null 2>/dev/null + printf '' | "$REMEMBERING" -p p4 -- sh -c "exit $status" 1>/dev/null 2>/dev/null STATUS=$? assert_status "$status" done |
