1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
@echo off
setlocal
if "%FUZZER%" == "" (
echo Environment variable FUZZER not set
exit /b 1
)
if "%PASSWORD_STORE_DIR%" == "" (
set PASSWORD_STORE_DIR="%USERPROFILE%\.local\share\pass\"
)
if not exist "%PASSWORD_STORE_DIR%" (
echo %PASSWORD_STORE_DIR% not set
exit /b 1
)
for /f %%i in ('"gopass ls -f | %FUZZER%"') do (
set selected_pass=%%i
)
if "%selected_pass%" equ "" (
exit /b
)
if "%1" equ "" (
if "%selected_pass:~0,5%" equ "totp/" (
gopass otp -c %selected_pass%
) else (
gopass show -c %selected_pass%
)
) else (
gopass %1 %selected_pass%
)
endlocal