~gpanders/ijq

Simplify debouncing code

Use the time.AfterFunc function which is a bit more straightforward.
This also solves a problem where the timeout code would execute when the
program launched, caused by the fact that a timer immediately starts
when it is created. This would cause the output view to be updated
before any input was entered, which resulted in incorrect output when a
custom filter string was entered.
Allow multiple files on command line

Each input file is concatenated to create the full input. This mirrors
jq's behavior.
Allow filter to be specified on command line

This makes ijq usage match jq more closely. Consider the following
cases:

1. A filter file is passed using the `-f` flag. In this case, all
   positional arguments should be treated as input files. If no
   arguments exist, read from stdin
2. Two or more arguments are passed. In this case, the first argument is
   treated as the filter text and all remaining arguments are treated as
   input files. No data is read from stdin, even if ijq is part of a
   pipeline (this matches jq's behavior)
3. Exactly one argument is passed. If data is present on stdin, treat
   the argument as a filter; otherwise, treat the argument as an input
   data file
4. No arguments are passed. If data is present on stdin, start ijq with
   the default filter; error otherwise.
Prefer log.Fatal over calling os.Exit manually
0af2fa6b — Gregory Anders 4 months ago
Update asset filename in README
1f7f7786 — Gregory Anders 4 months ago v0.1.1
Update version number
ea4a58f2 — Gregory Anders 4 months ago
Debounce filter input

Entering input too quickly (e.g. holding a single key) causes array
indexing errors in the tview library. This is most likely a concurrency
issue caused by a race condition on the `outputWriter` in the filter
input's asynchronous `ChangedFunc`.

My solution to this problem is to debounce the filter input so that the
filter is only executed at most every millisecond. This causes a
noticeable amount of input latency when a single key is held down, but
it's better than the program crashing.
b4e9a4d1 — Gregory Anders 4 months ago
Remove superfluous example in README
1a3cdb3c — Gregory Anders 4 months ago
Use canonical Makefile variable names

Makefile conventions use lowercase for `prefix` and `bindir`, as well as
`install -d` over `mkdir -p` [1].

[1]: https://www.gnu.org/software/make/manual/html_node/Makefile-Conventions.html#Makefile-Conventions
75c2c69a — Gregory Anders 4 months ago
Fix asset name in README example
a030a142 — Gregory Anders 4 months ago
Update build manifest
4ba4e0a1 — Gregory Anders 4 months ago
Add build manifest
7a1f5845 — Gregory Anders 4 months ago
Read initial filter from file with -f flag
933aba7d — Gregory Anders 4 months ago
Update installation instructions in README
d95cb9e3 — Gregory Anders 4 months ago
Add command to print version
da193a98 — Gregory Anders 4 months ago
Strip binary to reduce file size
4f3a03ad — Gregory Anders 4 months ago
Print filter to stderr on exit
24c5e6c4 — Gregory Anders 4 months ago
Update asciicast url in README
f0e27ae6 — Gregory Anders 4 months ago
Error if no data on stdin when trying to read
409af903 — Gregory Anders 4 months ago
Add commandline flags to pass through to jq
Next