Add command line arguments

This commit is contained in:
the Sane 2021-01-30 14:32:16 -05:00 committed by GitHub
parent 0018591192
commit 70f282d012
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,20 +45,6 @@
# https://github.com/richardtatum/sc-runner-updater
############################################################################
# Nobody expects the spanish inquisition.
while [ $# -gt 0 ]
do
case "$1" in
--help|-h|-? )
printf "\n$0: There are currently no command line arguments, this is actually a GUI script.\nRun this command again without any arguments.\n\n"
exit 0
;;
* )
;;
esac
shift;
done
# Check for dependencies
if [ ! -x "$(command -v curl)" ]; then
# Print to stderr and also try warning the user through notify-send
@ -1217,6 +1203,60 @@ fi
live_or_ptu="LIVE"
lutris_needs_restart="false"
# If invoked with command line arguments, process them and exit
if [ "$#" -gt 0 ]; then
while [ "$#" -gt 0 ]
do
# Victor_Tramp expects the spanish inquisition.
case "$1" in
--help|-h|-?)
printf "Star Citizen Linux Users Group Helper Script
Usage: lug-helper <options>
--preflight-check Run system optimization checks
--manage-runners Install or remove Lutris runners
--sanitize Delete Star Citizen USER folder, preserving keybinds
--delete-shaders Delete Star Citizen shaders directory
--delete-dxvk-cache Delete Star Citizen dxvk cache file
--get-referral Get a random LUG member's Star Citizen referral code
--reset-helper Delete saved lug-helper configs
"
exit 0
;;
--preflight-check)
preflight_check
;;
--manage-runners)
runner_manage
;;
--sanitize)
sanitize
;;
--delete-shaders)
rm_shaders
;;
--delete-dxvk-cache)
rm_vidcache
;;
--get-referral)
referral_randomizer
;;
--reset-helper)
reset_helper
;;
*)
printf "$0: Invalid option '$1'\n"
exit 0
;;
esac
# Shift forward to the next argument and loop again
shift
done
exit 0
fi
# Loop the main menu until the user selects quit
while true; do
# Configure the menu