diff options
Diffstat (limited to 'plugins/jsontools/jsontools.plugin.zsh')
-rw-r--r-- | plugins/jsontools/jsontools.plugin.zsh | 12 |
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())) |