#!/usr/bin/env zsh # Sign files with SSH setopt LOCAL_OPTIONS ERR_RETURN NO_UNSET PIPE_FAIL zmodload zsh/zutil local -a o_keyfile=(-f ~/.ssh/id_ed25519) local -a o_namespace=(-n file) local -a o_help=() zparseopts -D -K -- f:=o_keyfile n:=o_namespace h=o_help if [[ ${#o_help} -ne 0 ]]; then print "usage: ${0} [-h] [-f KEYFILE] [-n NAMESPACE] …" return 0 fi ssh-keygen -Y sign ${o_keyfile} ${o_namespace} ${@}