summaryrefslogtreecommitdiff
path: root/scripts/jv_cli.ps1
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/jv_cli.ps1')
-rw-r--r--scripts/jv_cli.ps137
1 files changed, 37 insertions, 0 deletions
diff --git a/scripts/jv_cli.ps1 b/scripts/jv_cli.ps1
new file mode 100644
index 0000000..0584c21
--- /dev/null
+++ b/scripts/jv_cli.ps1
@@ -0,0 +1,37 @@
+$SCRIPT_DIR = Split-Path -Parent $MyInvocation.MyCommand.Definition
+
+##############
+### CONFIG ###
+##############
+
+# Use JV_LANG to set CLI language
+# Supported: en, zh-CN
+# $env:JV_LANG = "en"
+
+###############
+### ALIASES ###
+###############
+
+Set-Alias jvh jv here
+Set-Alias jvu jv update
+Set-Alias jvt jv track
+Set-Alias jmv jv move
+
+##################
+### COMPLETION ###
+##################
+
+if (Test-Path "$SCRIPT_DIR\completions\powershell\completion_jv.ps1") {
+ . "$SCRIPT_DIR\completions\powershell\completion_jv.ps1"
+}
+if (Test-Path "$SCRIPT_DIR\completions\powershell\completion_jvv.ps1") {
+ . "$SCRIPT_DIR\completions\powershell\completion_jvv.ps1"
+}
+
+###################
+### ENVIRONMENT ###
+###################
+
+if (Test-Path "$SCRIPT_DIR\bin") {
+ $env:PATH = "$SCRIPT_DIR\bin;" + $env:PATH
+}