Ask for confirmation on fuzzy entry matching
This commit is contained in:
parent
fb5e6e6c35
commit
ffdc0f664f
@ -19,7 +19,10 @@ Behaviour:
|
|||||||
It will try to find a username/password entry in the configured backend
|
It will try to find a username/password entry in the configured backend
|
||||||
(currently only pass) for the current website and will load that pair of
|
(currently only pass) for the current website and will load that pair of
|
||||||
username and password to any form on the current page that has some password
|
username and password to any form on the current page that has some password
|
||||||
entry field.
|
entry field. If multiple entries are found, a zenity menu is offered.
|
||||||
|
|
||||||
|
If no entry is found, then it crops subdomains from the url if at least one
|
||||||
|
entry is found in the backend. (In that case, it always shows a menu)
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
@ -92,6 +95,8 @@ no_entries_found() {
|
|||||||
simple_url=$(sed 's,^[^.]*\.,,' <<< "$simple_url")
|
simple_url=$(sed 's,^[^.]*\.,,' <<< "$simple_url")
|
||||||
query_entries "$simple_url"
|
query_entries "$simple_url"
|
||||||
#die "No entry found for »$simple_url«"
|
#die "No entry found for »$simple_url«"
|
||||||
|
# enforce menu if we do "fuzzy" matching
|
||||||
|
menu_if_one_entry=1
|
||||||
done
|
done
|
||||||
if [ 0 -eq "${#files[@]}" ] ; then
|
if [ 0 -eq "${#files[@]}" ] ; then
|
||||||
die "No entry found for »$simple_url«"
|
die "No entry found for »$simple_url«"
|
||||||
@ -140,9 +145,11 @@ choose_entry_random() {
|
|||||||
# dmenu or zenity or even qutebrowser completion in future?) which entry to
|
# dmenu or zenity or even qutebrowser completion in future?) which entry to
|
||||||
# pick
|
# pick
|
||||||
MENU_COMMAND=( head -n 1 )
|
MENU_COMMAND=( head -n 1 )
|
||||||
|
# whether to show the menu if there is only one entrie in it
|
||||||
|
menu_if_one_entry=0
|
||||||
choose_entry_menu() {
|
choose_entry_menu() {
|
||||||
local nr=${#files[@]}
|
local nr=${#files[@]}
|
||||||
if [ "$nr" -eq 1 ] ; then
|
if [ "$nr" -eq 1 ] && ! ((menu_if_one_entry)) ; then
|
||||||
file="${files[0]}"
|
file="${files[0]}"
|
||||||
else
|
else
|
||||||
file=$( printf "%s\n" "${files[@]}" | "${MENU_COMMAND[@]}" )
|
file=$( printf "%s\n" "${files[@]}" | "${MENU_COMMAND[@]}" )
|
||||||
|
Loading…
Reference in New Issue
Block a user