Files
amodem/contrib/neopg-trezor
Roman Zeyde 71b56e15d7 Add NeoPG commandline wrapper for TREZOR-based agent
It invokes `trezor-gpg-agent` instead of `neopg agent`, by putting
its own path at argv[0].
2018-07-01 12:04:32 +03:00

13 lines
250 B
Python
Executable File

#!/usr/bin/env python3
import os
import shutil
import sys
agent = 'trezor-gpg-agent'
binary = 'neopg'
if sys.argv[1:2] == ['agent']:
os.execvp(agent, [agent, '-vv'] + sys.argv[2:])
else:
os.execvp(binary, [__file__, 'gpg2'] + sys.argv[1:])