Skip to content

Commit

Permalink
fix: update grep command in remove_history to handle leading dashes
Browse files Browse the repository at this point in the history
  • Loading branch information
LangLangBart committed May 9, 2024
1 parent 2006b0c commit 34c90bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gh-find-code
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ add_history() {

# Removing a specified line from the history file.
remove_history() {
# Remove the specified line from the history file
command grep --fixed-strings --line-regexp --invert-match "$*" \
# Attach '--regexp' directly to its argument to handle leading dashes.
command grep --fixed-strings --line-regexp --invert-match --regexp="$*" \
"$gh_find_code_history" >"$store_gh_find_code_history_tmp"

command mv "$store_gh_find_code_history_tmp" "$gh_find_code_history"
Expand Down

0 comments on commit 34c90bb

Please sign in to comment.