次の方法は?
コマンドが次の場合
git show .....
その後実行
git show ..... | bat -l rs
私は、| bat -l rs
実行する前にコマンドの最後に追加することを意味します。
ベストアンサー1
#!/bin/bash
case "$1" in
show) git "$@" | bat -l rs ;;
*) git "$@" ;;
esac
次に、このスクリプトのエイリアスをgit
。git show
\git
または、シェル関数を定義し、を使用してcommand
シェルrcファイルに追加します(bash
-syntax)。
git() {
case "$1" in
show) command git "$@" | bat -l rs ;;
*) command git "$@" ;;
esac
}