Skip to content
This repository was archived by the owner on Oct 16, 2021. It is now read-only.

Commit 2c96815

Browse files
committedApr 22, 2020
passrs.fish: fix trimming
I figured `string trim -r -c ".gpg"` would remove `.gpg` literally from the end of whatever line it was given. However, it removes the characters `.`, `g`, and `p` from the end, not caring about the order, leading to `entry/otp.gpg` being completed as `entry/ot`. Replace with a regex `string replace`. Likewise for removing the store path.
1 parent 61fcab2 commit 2c96815

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎completions/passrs.fish

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ end
1515

1616
function __fish_passrs_entries
1717
set -l store (__fish_passrs_store)
18-
printf "%s\n" "$store"/**.gpg | string trim -l -c "$store" | string trim -r -c ".gpg"
18+
printf "%s\n" "$store"/**.gpg | string replace -r "$store"'/(.*)' '$1' | string replace -r '(.*)\.gpg' '$1'
1919
end
2020

2121
function __fish_passrs_dirs
2222
set -l store (__fish_passrs_store)
23-
printf "%s\n" "$store"/**/ | string trim -l -c "$store"
23+
printf "%s\n" "$store"/**/ | string replace -r "$store"'/(.*)' '$1'
2424
end
2525

2626
function __fish_passrs_all

0 commit comments

Comments
 (0)
This repository has been archived.