Why Nostr? What is Njump?
2024-03-24 14:29:13
in reply to

menherahair on Nostr: eisai >The array itself, yes, but the item named “sequence” seems nowhere to be ...


>The array itself, yes, but the item named “sequence” seems nowhere to be defined.
Oh, sorry, I thought this was what confused you because I personally think that's confusing, when most of the code is very careful about this.

The array is build dynamically, see:
> 163 local -A uservars
> 164 local name val
> 165 while IFS=: read -r name val; do
> 166 [[ -z "$name" ]] && continue
> 167 val="${val# }"
> 168 uservars["${name}"]="$val"
> 169 done

It's parsing password files used in pass, which by mere convention look like this:
> correct horse battery staple
> login: wojtekwarrior97
> email: [email protected]
> more arbitrary fields that actually do nothing: it's just what `pass` recommends for some coherence between helper scripts and plugins

So the user is expected to setup one for this feature to work:
> sequence: $login \t %s \n
Otherwise it falls back to the wordy $PASS_ZENITY_DEFAULT_SEQUENCE, and if that's empty it fails.

>I have a suspicion, that they’re in fact not. Try inserting
>declare -p env_default_sequence
>right after the call to _globals()
Works fine:
> kishu ~/git/pass-zenity $ PASSWORD_STORE_EXTENSIONS_DIR=. PASS_ZENITY_DEFAULT_SEQUENCE=pizza bash $(command -v pass) zenity --sequence --typetool cat
> pizza
> kishu ~/git/pass-zenity $ g env_ out
> declare -r env_default_sequence="pizza"
> declare -r env_directory="/home/menherahair/.local/password-store"
> declare -r env_height=""
Author Public Key
npub1n783957maa2g7rpdyd5knx0whfggllws33clq9qg4dme3wauxrvq6q87ev