2024-10-08 10:00:42 +02:00
function pipup
switch $argv [ 1 ]
2024-10-11 16:40:13 +02:00
case update
2024-10-08 10:00:42 +02:00
python -m pip list --outdated --format = json | python -c "import json, sys; print('\n'.join([x['name'] for x in json.load(sys.stdin)]))" | xargs -n1 python -m pip install -U
2024-10-11 16:40:13 +02:00
case list
2024-10-08 10:00:42 +02:00
python -m pip list --outdated
2024-10-11 16:40:13 +02:00
case help
2024-10-08 10:00:42 +02:00
echo "Help:"
echo "- update: Updates all installed Python packages"
echo "- list: Lists all Python packages that need updates"
case '*'
echo " Unknown command: $argv [1] "
echo "Use `help` to see available commands"
end
2024-10-11 16:40:13 +02:00
end