Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(issue,pr)!: add live query mode using github search syntax #32

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
601fbe1
feat(issue): add live search mode using github syntax
benelan Jul 11, 2024
af8dc37
feat(ui): change fzf border style to use less screen space
benelan Jul 11, 2024
795a429
fix(issue): use border label to store search mode state
benelan Jul 11, 2024
3413f78
refactor: add additional mode indicator
benelan Jul 11, 2024
9c8c39d
feat(issue): improve filter keybind behavior during live search
benelan Jul 12, 2024
83dbcbd
Merge remote-tracking branch 'origin/main' into live-search
benelan Jul 12, 2024
2abc217
feat(issue): make `ctrl-r` keybind reset the live search state
benelan Jul 12, 2024
51070ae
fix(issue): use the same trailing character for the prompt
benelan Jul 12, 2024
a14c97f
chore: cleanup
benelan Jul 12, 2024
71a1f51
Merge remote-tracking branch 'origin/main' into live-search
benelan Jul 12, 2024
6cd96b6
style(issue): lowercase command-specific variables
benelan Jul 13, 2024
c117642
fix(issue) add state filter to query in gh mode
benelan Jul 13, 2024
7be8388
fix(issue): resolve invalid transform action syntax
benelan Jul 13, 2024
fcdd29a
feat(pr): add mode to live query via github search syntax
benelan Jul 13, 2024
3de9126
refactor!: add fzf version check
benelan Jul 14, 2024
58c0473
feat(issue): get milestone filter working with gh search mode
benelan Jul 14, 2024
7c58b21
chore: cleanup
benelan Jul 14, 2024
7720223
Merge remote-tracking branch 'origin/main' into live-search
benelan Jul 14, 2024
3f82f64
Merge remote-tracking branch 'origin/main' into live-search
benelan Jul 22, 2024
ec984e8
Merge remote-tracking branch 'origin/main' into live-search
benelan Jul 30, 2024
a445bb8
Merge remote-tracking branch 'origin/main' into live-search
benelan Sep 26, 2024
05dc5c8
Merge remote-tracking branch 'origin/main' into live-search
benelan Nov 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor!: add fzf version check
  • Loading branch information
benelan committed Jul 14, 2024
commit 3de9126accaecfcb13a28171a5dcca7fb49077a2
81 changes: 64 additions & 17 deletions gh-fzf
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,23 @@ set -e

GH_FZF_VERSION="v0.13.0" # x-release-please-version

# USAGE INFO AND LOGS {{{1
FZF_USER_VERSION="$(fzf --version | awk '{print $1}')"

# USAGE INFO AND INTERNAL FUNCTIONS {{{1

has() { command -v "$1" >/dev/null 2>&1; }

# https://apple.stackexchange.com/a/123408
version_number() {
echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'
}

requires_version() {
if [ "$(version_number "$1")" -gt "$(version_number "$FZF_USER_VERSION")" ]; then
error "the minimum fzf version is $1 (found $FZF_USER_VERSION)"
fi
}

error() {
if [ -n "$1" ]; then
printf "Error: " >&2
Expand Down Expand Up @@ -1077,28 +1090,62 @@ find_repo_flag() {

# ENTRY FUNCTION {{{2
main() {
requires_version "0.45.0"

command="$1"
[ -n "$command" ] && shift || default_cmd

find_repo_flag "$@"

case $command in
h | -h | help | --help) help_cmd "$@" ;;
i | -i | issue | issues | --issue | --issues) issue_cmd "$@" ;;
p | -p | pr | prs | --pr | --prs) pr_cmd "$@" ;;
r | -r | run | runs | --run | --runs) run_cmd "$@" ;;
repo | repos | --repo | --repos) repo_cmd "$@" ;;
release | releases | --release | --releases) release_cmd "$@" ;;
gist | gists | --gist | --gists) gist_cmd "$@" ;;
workflow | workflows | --workflow | --workflows) workflow_cmd "$@" ;;
label | labels | --label | --labels) label_cmd "$@" ;;
milestone | milestones | --milestone | --milestones) milestone_cmd "$@" ;;
util | utils | --util | --utils) util_cmd "$@" ;;
changelog) gh fzf release --repo benelan/gh-fzf ;;
upgrade) gh extension remove benelan/gh-fzf >/dev/null 2>&1 &&
gh extension install benelan/gh-fzf --pin "stable" ;;
v | V | -v | -V | version | --version) printf "%s\n" "$GH_FZF_VERSION" ;;
*) error "invalid command: \"$command\"" ;;
h | -h | help | --help)
help_cmd "$@"
;;
i | -i | issue | issues | --issue | --issues)
requires_version "0.49.0"
issue_cmd "$@"
;;
p | -p | pr | prs | --pr | --prs)
requires_version "0.49.0"
pr_cmd "$@"
;;
r | -r | run | runs | --run | --runs)
run_cmd "$@"
;;
repo | repos | --repo | --repos)
repo_cmd "$@"
;;
release | releases | --release | --releases)
release_cmd "$@"
;;
gist | gists | --gist | --gists)
gist_cmd "$@"
;;
workflow | workflows | --workflow | --workflows)
workflow_cmd "$@"
;;
label | labels | --label | --labels)
label_cmd "$@"
;;
milestone | milestones | --milestone | --milestones)
milestone_cmd "$@"
;;
util | utils | --util | --utils)
util_cmd "$@"
;;
changelog)
gh fzf release --repo benelan/gh-fzf
;;
upgrade)
gh extension remove benelan/gh-fzf >/dev/null 2>&1 &&
gh extension install benelan/gh-fzf --pin "stable"
;;
v | V | -v | -V | version | --version)
printf "%s\n" "$GH_FZF_VERSION"
;;
*)
error "invalid command: \"$command\""
;;
esac
} #2}}}

Expand Down