Skip to content

Instantly share code, notes, and snippets.

@bashelled
Created April 5, 2021 11:35
Show Gist options
  • Save bashelled/ed6bb6ba83b22eaa0c5a1c099b38f19d to your computer and use it in GitHub Desktop.
Save bashelled/ed6bb6ba83b22eaa0c5a1c099b38f19d to your computer and use it in GitHub Desktop.
An XBPS shortcut for Void Linux
#!/bin/bash
usage () {
echo "Usage: xbps COMMAND [OPTIONS] [PACKAGES...]"
echo ""
echo "A shortcut to xbps commands."
echo ""
echo "[-h, --help, help, blank]: Shows this help"
echo "[-v, --ver, --version, ver, version]: Shows your XBPS version"
}
if [[ -z "$1" || "$1" == "--help" || "$1" == "help" || "$1" == "-h" ]]; then
usage
elif [[ "$1" == "version" || "$1" == "ver" || "$1" == "-v" || "$1" == "--version" || "$1" == "--ver" ]]; then
xbps-query --version
else
if [[ -f /bin/xbps-$1 ]]; then
xbps-$1 $2 $3 $4 $5 $6 $7
else
echo "Command $1 was not found."
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment