Files
dotfiles/google/hgshort/tobashargs.sh
2022-08-15 17:06:33 +00:00

12 lines
353 B
Bash
Executable File

#!/bin/bash
HGSHORT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-${(%):-%x}}}")" && pwd)"
export HGSHORT_BASH_CMD="$1"
export HGSHORT_BASH_ARGS="/tmp/HGSHORT-bash-args-$$.sh"
shift
$HGSHORT_DIR/tobashargs.py "$@" > $HGSHORT_BASH_ARGS
xargs --null --arg-file=$HGSHORT_BASH_ARGS $HGSHORT_BASH_CMD
\rm $HGSHORT_BASH_ARGS # don't call rm to avoid alias loop