Created
September 26, 2021 07:59
-
-
Save iomarmochtar/c3db8da3462f4cfd5f540d5bfc5b38a3 to your computer and use it in GitHub Desktop.
shell function to make viddy read an alias with it's arguments in zsh or bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# modified version of https://github.com/sachaos/viddy/issues/2#issuecomment-907586514 for respecting passed arguments | |
# eg: vd kgp -n flux-system | |
function vd() { | |
args=$(echo $* | cut -d' ' -f 2-) | |
real_cmd=$(which $1 | cut -d' ' -f 4-) | |
viddy -d -n 1 --shell $SHELL "$real_cmd $args" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment