[!windows] chmod 755 bin/pass
[windows] unix2dos bin/pass.cmd
[windows] unix2dos golden/pass-raw

# test pass template function
exec chezmoi execute-template '{{ pass "misc/example.com" }}'
stdout ^examplepassword$

# test passFields template function
exec chezmoi execute-template '{{ (passFields "misc/example.com").login }}'
stdout ^examplelogin$

# test pass template function
exec chezmoi execute-template '{{ passRaw "misc/example.com" }}'
cmp stdout golden/pass-raw

-- bin/pass --
#!/bin/sh

case "$*" in
"show misc/example.com")
    echo "examplepassword"
    echo "login: examplelogin"
    ;;
*)
    echo "pass: invalid command: $*"
    exit 1
esac
-- bin/pass.cmd --
@echo off
IF "%*" == "show misc/example.com" (
    echo.examplepassword
    echo.login: examplelogin
    exit /b 0
) ELSE (
    echo pass: invalid command: %*
    exit /b 1
)
-- golden/pass-raw --
examplepassword
login: examplelogin
