[RFC] Add fzf support#38
Conversation
A quick and dirty implementation to select a query result (sunaku#37).
| @@ -0,0 +1,107 @@ | |||
| #!/bin/sh -e | |||
| # | |||
| # # DASHT-QUERY-HTML 1 2018-10-09 2.3.0 | |||
There was a problem hiding this comment.
All mentions of the old dasht-query-html should be changed to dasht-query-fzf.
| if (pattern == "") pattern = "^." # grouped by leading character | ||
| } | ||
| NR == 1 {} | ||
| $2 == "=" { result[$1] = substr($0, index($0, $2) + length($2) + 1) } |
There was a problem hiding this comment.
We need to share this AWK preamble (all of the lines above this one) with the dasht-query-html script to avoid copy/paste duplication. 🤔 Perhaps we can write a separate script that just does this preamble and emits the search results in an intermediate format, which the *-html and this *-fzf scripts can then transform into their final output formats.
|
Thanks for the PR 👍 I'll merge it after some clean up. 😅 |
Ah cool, I didn't expect it was already good enough to be merged. IMHO it's a bit confusing that |
|
Before realizing that there was an existing PR for this, I wrote a version myself that has some advantages and disadvantages vis-a-vis this one. My version:
But IMO, rather than including So what if:
It seems to me that outputting "neutral" query results by default would serve the typical user better, who wants to use I'm willing to implement the above changes if you're interested @sunaku. |
|
Pinging @sunaku on this-- I've made most of the above changes to my private fork and can submit a PR if you are interested in changing the interface in this way. |
|
Hi @smackesey, I like your idea of emitting TSV as an intermediate format in #38 (comment). Please submit a PR for it, thanks. |
|
@sunaku Two questions:
|
|
Hi @smackesey,
Notably, please exclude these changes from the TSV PR:
|
A quick and dirty implementation to select a query result (#37).