Skip to content

Instantly share code, notes, and snippets.

@kuchida1981
Last active December 23, 2023 14:29
Show Gist options
  • Save kuchida1981/ceeca4a982270a06a64c368a664b80a2 to your computer and use it in GitHub Desktop.
Save kuchida1981/ceeca4a982270a06a64c368a664b80a2 to your computer and use it in GitHub Desktop.
function checkupdates --description 'alias checkupdates=checkupdates'
argparse -i --name=checkupdates 'h/help' 'j/json' -- $argv
or return 1
function _show_usage
command checkupdates --help | sed "s/^checkupdates.*\$/& + custom/" | grep -v "nosync"
echo '
Extra Options:
-j, --json json output'
functions -e _show_usage
return 0
end
if set -lq _flag_help
_show_usage
return 0
end
if set -lq _flag_json
begin
echo "package current __symbol new"
command checkupdates -n $argv
end | jc --csv | jq -c 'del(.[].__symbol)'
else
command checkupdates -n $argv
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment