summaryrefslogtreecommitdiff
path: root/plugins/jsontools
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2022-05-23 12:25:11 -0600
committerTuowen Zhao <ztuowen@gmail.com>2022-05-23 12:25:11 -0600
commit901674e84756d64024cdc70f9590c3557c6d92d6 (patch)
treed3b90c50a39f4a7f220b0a19718dc305fe1c7af4 /plugins/jsontools
parent2023d3ab658fe8ed4dd4ca33cd5974ab8f0ad945 (diff)
parent39b600e9e564db3dec265fcf2e3db4b5568dd93a (diff)
downloadzsh-901674e84756d64024cdc70f9590c3557c6d92d6.tar.gz
zsh-901674e84756d64024cdc70f9590c3557c6d92d6.tar.bz2
zsh-901674e84756d64024cdc70f9590c3557c6d92d6.zip
Merge remote-tracking branch 'github/master'
Diffstat (limited to 'plugins/jsontools')
-rw-r--r--plugins/jsontools/jsontools.plugin.zsh12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/jsontools/jsontools.plugin.zsh b/plugins/jsontools/jsontools.plugin.zsh
index 857ca0ec9..49828d32d 100644
--- a/plugins/jsontools/jsontools.plugin.zsh
+++ b/plugins/jsontools/jsontools.plugin.zsh
@@ -8,7 +8,7 @@ fi
# If method undefined, find the first one that is installed
if [[ -z "$JSONTOOLS_METHOD" ]]; then
- for JSONTOOLS_METHOD in node python ruby; do
+ for JSONTOOLS_METHOD in node python3 ruby; do
# If method found, break out of loop
(( $+commands[$JSONTOOLS_METHOD] )) && break
# Otherwise unset the variable
@@ -45,12 +45,12 @@ case "$JSONTOOLS_METHOD" in
xargs -0 node -e "console.log(decodeURIComponent(process.argv[1]))"
}
;;
- python)
+ python3)
function pp_json() {
- python -c 'import sys; del sys.path[0]; import runpy; runpy._run_module_as_main("json.tool")'
+ python3 -c 'import sys; del sys.path[0]; import runpy; runpy._run_module_as_main("json.tool")'
}
function is_json() {
- python -c '
+ python3 -c '
import sys; del sys.path[0];
import json
try:
@@ -61,14 +61,14 @@ except ValueError:
'
}
function urlencode_json() {
- python -c '
+ python3 -c '
import sys; del sys.path[0];
from urllib.parse import quote_plus
print(quote_plus(sys.stdin.read()))
'
}
function urldecode_json() {
- python -c '
+ python3 -c '
import sys; del sys.path[0];
from urllib.parse import unquote_plus
print(unquote_plus(sys.stdin.read()))