From 9a00a664fee0b828c435bb8749dcaa0cead32b22 Mon Sep 17 00:00:00 2001 From: exu Date: Tue, 8 Oct 2024 10:00:42 +0200 Subject: [PATCH] Add fish function for updating pip packages --- arch-config/.config/fish/functions/pipup.fish | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 arch-config/.config/fish/functions/pipup.fish diff --git a/arch-config/.config/fish/functions/pipup.fish b/arch-config/.config/fish/functions/pipup.fish new file mode 100644 index 00000000..e1570a8d --- /dev/null +++ b/arch-config/.config/fish/functions/pipup.fish @@ -0,0 +1,15 @@ +function pipup + switch $argv[1] + case 'update' + 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 + case 'list' + python -m pip list --outdated + case 'help' + 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 +end \ No newline at end of file