From 34c90bbad362908505f76d8e9e66a1395ed9e1d9 Mon Sep 17 00:00:00 2001 From: LangLangbart <92653266+LangLangBart@users.noreply.github.com> Date: Thu, 9 May 2024 15:23:32 +0200 Subject: [PATCH] fix: update grep command in remove_history to handle leading dashes --- gh-find-code | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gh-find-code b/gh-find-code index 4d75c39..a22e35b 100755 --- a/gh-find-code +++ b/gh-find-code @@ -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"