summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/jv_cli.ps118
-rw-r--r--scripts/jv_cli.sh23
2 files changed, 35 insertions, 6 deletions
diff --git a/scripts/jv_cli.ps1 b/scripts/jv_cli.ps1
index b77997c..0325578 100644
--- a/scripts/jv_cli.ps1
+++ b/scripts/jv_cli.ps1
@@ -17,10 +17,20 @@ $env:JV_AUTO_UPDATE = "yes"
### ALIASES ###
###############
-Set-Alias jvh jv here
-Set-Alias jvu jv update
-Set-Alias jvt jv track
-Set-Alias jmv jv move
+function jv {
+ param([string[]]$Arguments)
+ & (Get-Command jv -CommandType Application) @Arguments
+}
+
+function jvh { jv here @args }
+function jvu { jv update @args }
+function jvt { jv track @args }
+function jmv { jv move @args }
+
+Set-Alias jvh jvh
+Set-Alias jvu jvu
+Set-Alias jvt jvt
+Set-Alias jmv jmv
##################
### COMPLETION ###
diff --git a/scripts/jv_cli.sh b/scripts/jv_cli.sh
index 09b25ab..1e382d7 100644
--- a/scripts/jv_cli.sh
+++ b/scripts/jv_cli.sh
@@ -18,10 +18,29 @@ export JV_AUTO_UPDATE=yes
### ALIASES ###
###############
+# Disable glob expansion for jv commands across shells
+if [ -n "$BASH_VERSION" ]; then # Bash
+ alias jv='set -f; command jv; set +f'
+ alias jvt='set -f; command jv track; set +f'
+ alias jmv='set -f; command jv move; set +f'
+elif [ -n "$ZSH_VERSION" ]; then # Zsh
+ alias jv='noglob jv'
+ alias jvt='noglob jv track'
+ alias jmv='noglob jv move'
+elif [ -n "$FISH_VERSION" ]; then # Fish
+ function jv {
+ command jv $@
+ }
+ function jvt {
+ command jv track $@
+ }
+ function jmv {
+ command jv move $@
+ }
+fi
+
alias jvh='jv here'
alias jvu='jv update'
-alias jvt='jv track'
-alias jmv='jv move'
##################
### COMPLETION ###