25 lines
617 B
Plaintext
25 lines
617 B
Plaintext
|
# pass aliases / completion
|
||
|
def _pass_completion [] {
|
||
|
_ls ~/.password-store/**/* | each { |x|
|
||
|
if $x.type == "file" {
|
||
|
$x.name
|
||
|
| path parse
|
||
|
| update extension ""
|
||
|
| get parent stem
|
||
|
| str join "/"
|
||
|
} else {
|
||
|
$x.name + "/"
|
||
|
}
|
||
|
| split row '/'
|
||
|
| skip 4
|
||
|
| str join "/"
|
||
|
}
|
||
|
| prepend git
|
||
|
| prepend insert
|
||
|
}
|
||
|
|
||
|
export extern "pass" [ host?: string@_pass_completion ]
|
||
|
def p [ arg: string@_pass_completion ] { pass $arg }
|
||
|
def pc [ arg: string@_pass_completion ] { pass --clip $arg }
|
||
|
|