mirror of
https://github.com/oSoWoSo/DistroHopper.git
synced 2024-08-14 22:46:53 +00:00
Add list argument to quickget. Close #97
For UI creators, `quickget list` will print to strdout asll the support operating systems and releases.
This commit is contained in:
parent
abd5e99c47
commit
b7493cee10
1 changed files with 89 additions and 45 deletions
134
quickget
134
quickget
|
@ -1,8 +1,45 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
function list_all() {
|
||||
local DISPLAY_NAME
|
||||
local FUNC
|
||||
local LANG
|
||||
local OS
|
||||
local RELEASE
|
||||
echo "Display Name,OS,Release,Language"
|
||||
for OS in $(os_support); do
|
||||
if [[ "${OS}" == *"ubuntu"* ]]; then
|
||||
FUNC="ubuntu"
|
||||
else
|
||||
FUNC="${OS}"
|
||||
fi
|
||||
case ${OS} in
|
||||
freebsd) DISPLAY_NAME="FreeBSD";;
|
||||
linuxmint) DISPLAY_NAME="Linux Mint";;
|
||||
macos) DISPLAY_NAME="macOS";;
|
||||
opensuse) DISPLAY_NAME="OpenSUSE";;
|
||||
ubuntu-budgie) DISPLAY_NAME="Ubuntu Budgie";;
|
||||
ubuntu-kylin) DISPLAY_NAME="Ubuntu Kylin";;
|
||||
ubuntu-mate) DISPLAY_NAME="Ubuntu MATE";;
|
||||
ubuntu-studio) DISPLAY_NAME="Ubuntu Studio";;
|
||||
*) DISPLAY_NAME="${OS^}";;
|
||||
esac
|
||||
for RELEASE in $("releases_${FUNC}"); do
|
||||
if [ "${OS}" == "windows" ]; then
|
||||
for LANG in "${LANGS[@]}"; do
|
||||
echo "${DISPLAY_NAME},${OS},${RELEASE},${LANG}",
|
||||
done
|
||||
else
|
||||
echo "${DISPLAY_NAME},${OS},${RELEASE},,"
|
||||
fi
|
||||
done
|
||||
done
|
||||
exit 0
|
||||
}
|
||||
|
||||
function os_support() {
|
||||
echo freebsd \
|
||||
fedora \
|
||||
echo fedora \
|
||||
freebsd \
|
||||
kubuntu \
|
||||
linuxmint \
|
||||
lubuntu \
|
||||
|
@ -39,8 +76,8 @@ function releases_opensuse(){
|
|||
15_1 \
|
||||
15_2 \
|
||||
15_3 \
|
||||
tumbleweed \
|
||||
microos
|
||||
microos \
|
||||
tumbleweed
|
||||
}
|
||||
|
||||
function releases_macos() {
|
||||
|
@ -59,44 +96,44 @@ function releases_ubuntu() {
|
|||
}
|
||||
|
||||
function languages_windows() {
|
||||
echo Arabic \
|
||||
Brazilian Portuguese \
|
||||
Bulgarian \
|
||||
Chinese \(Simplified\) \
|
||||
Chinese \(Traditional\) \
|
||||
Croatian \
|
||||
Czech \
|
||||
Danish \
|
||||
Dutch \
|
||||
English \
|
||||
English International \
|
||||
Estonian \
|
||||
Finnish \
|
||||
French \
|
||||
French Canadian \
|
||||
German \
|
||||
Greek \
|
||||
Hebrew \
|
||||
Hungarian \
|
||||
Italian \
|
||||
Japanese \
|
||||
Korean \
|
||||
Latvian \
|
||||
Lithuanian \
|
||||
Norwegian \
|
||||
Polish \
|
||||
Portuguese \
|
||||
Romanian \
|
||||
Russian \
|
||||
Serbian Latin \
|
||||
Slovak \
|
||||
Slovenian \
|
||||
Spanish \
|
||||
Spanish \(Mexico\) \
|
||||
Swedish \
|
||||
Thai \
|
||||
Turkish \
|
||||
Ukrainian
|
||||
LANGS=(Arabic
|
||||
"Brazilian Portuguese"
|
||||
Bulgarian
|
||||
"Chinese (Simplified)"
|
||||
"Chinese (Traditional)"
|
||||
Croatian
|
||||
Czech
|
||||
Danish
|
||||
Dutch
|
||||
English
|
||||
"English International"
|
||||
Estonian
|
||||
Finnish
|
||||
French
|
||||
"French Canadian"
|
||||
German
|
||||
Greek
|
||||
Hebrew
|
||||
Hungarian
|
||||
Italian
|
||||
Japanese
|
||||
Korean
|
||||
Latvian
|
||||
Lithuanian
|
||||
Norwegian
|
||||
Polish
|
||||
Portuguese
|
||||
Romanian
|
||||
Russian
|
||||
"Serbian Latin"
|
||||
Slovak
|
||||
Slovenian
|
||||
Spanish
|
||||
"Spanish (Mexico)"
|
||||
Swedish
|
||||
Thai
|
||||
Turkish
|
||||
Ukrainian)
|
||||
}
|
||||
|
||||
|
||||
|
@ -748,8 +785,14 @@ function get_windows() {
|
|||
start_vm_info
|
||||
}
|
||||
|
||||
LANGS=()
|
||||
languages_windows
|
||||
|
||||
if [ -n "${1}" ]; then
|
||||
OS="${1,,}"
|
||||
if [ "${OS}" == "list" ]; then
|
||||
list_all
|
||||
fi
|
||||
else
|
||||
echo "ERROR! You must specify an OS:"
|
||||
os_support
|
||||
|
@ -795,10 +838,11 @@ elif [[ "${OS}" == *"ubuntu"* ]]; then
|
|||
elif [ "${OS}" == "windows" ]; then
|
||||
if [ -n "${3}" ]; then
|
||||
LANG_NAME="${3}"
|
||||
LANG_NAMES=$(languages_windows)
|
||||
if [[ "${LANG_NAMES}" != *"${LANG_NAME}"* ]]; then
|
||||
if [[ ! ${LANGS[*]} =~ ${LANG_NAME} ]]; then
|
||||
echo "ERROR! ${LANG_NAME} is not a supported language:"
|
||||
languages_windows
|
||||
for LANG in "${LANGS[@]}"; do
|
||||
echo "${LANG}"
|
||||
done
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue