[PATCH] --fullpath option for find subcommand

Nils Andre nils at nilsand.re
Tue Apr 14 20:28:17 CEST 2020


On Tue, Apr 14, 2020 at 07:24:24PM +0200, Tobias Girstmair wrote:

> -	[[ $# -eq 0 ]] && die "Usage: $PROGRAM $COMMAND pass-names..."
> +	local opts extra_args=""
> +	opts="$($GETOPT -o f -l fullpath -n "$PROGRAM" -- "$@")"
> +	local err=$?
> +	eval set -- "$opts"
> +	while true; do case $1 in
> +		-f|--fullpath) extra_args="$extra_args -Ffi"; shift ;;
> +		--) shift; break ;;
> +	esac done

I think it would be best to have cmd_find as a wrapper around tree
similarly to how it works with git rather than like this where we
translate `-f|--fullpath` to something else.

> -	tree -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX"             | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g'
> +	tree -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case $extra_args "$PREFIX" | tail -n +2 | sed -E -e 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g' -e "s@^$PREFIX/?@@" -e '/\/$/d'

`-P` and `-I` (passed to tree) could maybe be used instead, to filter.


More information about the Password-Store mailing list