Skip to content

Commit 21a5cfa

Browse files
Copilotlunarcloud
andauthored
Run shellcheck on all branches, fix all violations, and update documentation (#31)
* Initial plan * Update GitHub Action to run shellcheck on every commit to all branches Co-authored-by: lunarcloud <1565970+lunarcloud@users.noreply.github.com> * Fix: Prevent duplicate workflow runs on PRs Co-authored-by: lunarcloud <1565970+lunarcloud@users.noreply.github.com> * Fix all shellcheck violations across the codebase Co-authored-by: lunarcloud <1565970+lunarcloud@users.noreply.github.com> * Update AGENTS.md to document new shellcheck and quoting requirements Co-authored-by: lunarcloud <1565970+lunarcloud@users.noreply.github.com> * Fix whiptail checklist showing usage text instead of TUI dialog Remove quotes from conditional --scrolltext argument to prevent empty string being passed as an argument when RECMD_SCROLL is false. Added shellcheck directives to document intentional word splitting. Co-authored-by: lunarcloud <1565970+lunarcloud@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lunarcloud <1565970+lunarcloud@users.noreply.github.com>
1 parent b05c4e7 commit 21a5cfa

10 files changed

Lines changed: 122 additions & 33 deletions

File tree

.github/workflows/analyze.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66
push:
77
branches: [ "master" ]
88
pull_request:
9-
branches: [ "master" ]
109

1110
workflow_dispatch:
1211

AGENTS.md

Lines changed: 61 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,12 @@ The repository is organized as follows:
3737
* Document all functions with clear descriptions of parameters and behavior.
3838
* Use consistent indentation (2 spaces).
3939
* Always quote variable expansions unless you specifically need word splitting.
40+
* Always quote command substitutions: `"$(command)"` not `$(command)`.
4041
* Use `[[ ]]` for pattern matching (wildcards, regex) and bash-specific features (case conversion).
4142
* Use `[ ]` for basic POSIX-compatible tests (string equality, -z, -n, numeric comparisons).
4243
* Use `command -v` instead of `which` for checking command existence.
44+
* Separate variable declarations from assignments that run commands: `local var; var=$(command)` instead of `local var=$(command)`.
45+
* Use shellcheck directives instead of exporting variables to avoid polluting the environment.
4346

4447
### Running Quality Checks Locally
4548

@@ -49,19 +52,14 @@ Before committing code, developers should run:
4952
# Restore dependencies (ubuntu/debian syntax)
5053
sudo apt install shellcheck
5154

52-
# Run the check on all scripts
53-
shellcheck script-dialog.sh
54-
shellcheck test.sh
55-
shellcheck screenshot-dialogs.sh
56-
57-
# Or check all at once
58-
shellcheck ./*.sh -x
55+
# Run the check on all scripts (including cross-file sourcing)
56+
shellcheck ./*.sh extras/*.sh -x
5957

6058
# Run integration tests (requires a terminal or GUI environment)
6159
bash test.sh
6260
```
6361

64-
And correct any remaining issues reported.
62+
All code must pass shellcheck with zero violations before committing.
6563

6664
## Bash-Specific Patterns and Best Practices
6765

@@ -115,6 +113,35 @@ The library detects platforms and desktop environments:
115113
- Windows/WSL: `[[ $OSTYPE == msys ]] || [[ $(uname -r | tr '[:upper:]' '[:lower:]') == *wsl* ]]` (pattern matching)
116114
- Linux desktops: Detected via `$XDG_CURRENT_DESKTOP`, `$XDG_SESSION_DESKTOP`, or running processes via `pgrep -l "process-name"` (gnome-shell, mutter, kwin)
117115

116+
### Shellcheck Directives and Cross-File Variables
117+
118+
The library uses a modular structure where `init.sh` defines variables used across multiple files. To handle shellcheck warnings about these cross-file variables:
119+
120+
1. **For variables defined in init.sh and used elsewhere**:
121+
- Add `# shellcheck disable=SC2154` at the top of files that use variables from init.sh
122+
- This suppresses "variable is referenced but not assigned" warnings
123+
124+
2. **For variables exposed to library users**:
125+
- Add `# shellcheck disable=SC2034` at the file level in init.sh
126+
- This suppresses "variable appears unused" warnings for intentionally exposed variables
127+
- Do NOT export these variables to avoid polluting the user's environment
128+
129+
3. **For intentional command word splitting**:
130+
- Quote command substitutions: `"$([ "$RECMD_SCROLL" == true ] && echo "--scrolltext")"`
131+
- This prevents SC2046 warnings while maintaining correct behavior
132+
133+
Example:
134+
```bash
135+
# At the top of a file using init.sh variables
136+
#!/usr/bin/env bash
137+
# Multi-UI Scripting - Helper Functions
138+
139+
# Variables set in init.sh and used here
140+
# shellcheck disable=SC2154
141+
142+
# Now you can use variables like $bold, $normal, $red without warnings
143+
```
144+
118145
## Cross-Platform Considerations
119146

120147
### Platform-Specific Behavior
@@ -164,14 +191,22 @@ Use `screenshot-dialogs.sh` to capture visual evidence of changes:
164191

165192
### Automated Testing (CI)
166193

167-
The GitHub Actions workflow runs shellcheck on all `.sh` files. All code must pass shellcheck without errors.
194+
The GitHub Actions workflow runs shellcheck on all `.sh` files for every PR and direct commit to master. All code must pass shellcheck without errors or warnings.
195+
196+
The workflow is configured to:
197+
- Run on all pull requests (via `pull_request` trigger)
198+
- Run on direct commits to `master` branch (via `push` trigger)
199+
- Avoid duplicate runs on PRs by not triggering `push` for non-master branches
168200

169201
## Common Patterns and Pitfalls to Avoid
170202

171203
### DO:
172204
* Capture exit status immediately after the command that generates it
173205
* Use `|| exit "$?"` after command substitutions that might be cancelled
174206
* Quote variable expansions: `"$variable"` not `$variable`
207+
* Quote command substitutions: `"$(command)"` not `$(command)`
208+
* Separate variable declarations from assignments: `local var; var=$(cmd)` not `local var=$(cmd)`
209+
* Use shellcheck directives for cross-file variables instead of exporting them
175210
* Test with multiple interfaces (zenity, kdialog, whiptail, dialog)
176211
* Document why you're disabling shellcheck rules if necessary
177212
* Consider both GUI and TUI behavior when implementing features
@@ -184,6 +219,8 @@ The GitHub Actions workflow runs shellcheck on all `.sh` files. All code must pa
184219
* Remove or modify cancel detection without thorough testing
185220
* Break backward compatibility with existing scripts
186221
* Copy complex patterns from other projects without understanding them
222+
* Export variables unnecessarily - use shellcheck directives instead to avoid environment pollution
223+
* Leave unquoted variables or command substitutions that trigger shellcheck warnings
187224

188225
## Recent Learnings from PR Feedback
189226

@@ -202,6 +239,21 @@ From PR #28 (Add configurable exit on dialog cancellation):
202239
- It follows the `timeout` command convention (which also uses 124)
203240
- It's less generic than 1 or 2
204241

242+
From PR (Shellcheck compliance and CI improvements):
243+
244+
1. **Quoting is mandatory**: All variable expansions and command substitutions must be quoted to pass shellcheck. This prevents word splitting and globbing issues.
245+
246+
2. **Separate declarations from assignments**: Using `local var=$(command)` masks the command's exit status. Always separate them: `local var; var=$(command)` followed by `exit_status=$?`.
247+
248+
3. **Use shellcheck directives, not exports**: When variables are defined in `init.sh` and used in other sourced files:
249+
- Add `# shellcheck disable=SC2154` at the top of files using those variables
250+
- Add `# shellcheck disable=SC2034` in init.sh for variables exposed to library users
251+
- Do NOT export variables just to satisfy shellcheck - this pollutes the user's environment
252+
253+
4. **CI must catch issues early**: The GitHub Actions workflow now runs on all PRs and master commits, ensuring code quality before merge.
254+
255+
5. **Zero tolerance for shellcheck violations**: All code must pass `shellcheck ./*.sh extras/*.sh -x` with zero warnings or errors.
256+
205257
## Boundaries and Guardrails
206258

207259
* **NEVER** add a feature only supported on one OS or desktop environment.

datepicker.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# https://github.com/lunarcloud/script-dialog
44
# LGPL-2.1 license
55

6+
# Variables set in init.sh and used here
7+
# shellcheck disable=SC2154
8+
69
#######################################
710
# Display a calendar date selector dialog
811
# GLOBALS:
@@ -42,13 +45,14 @@ function datepicker() {
4245

4346
local exit_status=0
4447
if [ "$INTERFACE" == "whiptail" ]; then
48+
# shellcheck disable=SC2034 # SYMBOL used by whiptail in this context
4549
local SYMBOL=$CALENDAR_SYMBOL
4650
STANDARD_DATE=$(inputbox "Input Date (DD/MM/YYYY)" "$NOW")
4751
elif [ "$INTERFACE" == "dialog" ]; then
4852
STANDARD_DATE=$(dialog --clear --backtitle "$APP_NAME" --title "$ACTIVITY" --stdout --calendar "${CALENDAR_SYMBOL}Choose Date" 0 40)
4953
exit_status=$?
5054
elif [ "$INTERFACE" == "zenity" ]; then
51-
INPUT_DATE=$(zenity --title="$GUI_TITLE" $ZENITY_ICON_ARG "$GUI_ICON" ${ZENITY_HEIGHT+--height=$ZENITY_HEIGHT} ${ZENITY_WIDTH+--width=$ZENITY_WIDTH} --calendar "Select Date")
55+
INPUT_DATE=$(zenity --title="$GUI_TITLE" "$ZENITY_ICON_ARG" "$GUI_ICON" ${ZENITY_HEIGHT+--height=$ZENITY_HEIGHT} ${ZENITY_WIDTH+--width=$ZENITY_WIDTH} --calendar "Select Date")
5256
exit_status=$?
5357
MONTH=$(echo "$INPUT_DATE" | cut -d'/' -f1)
5458
DAY=$(echo "$INPUT_DATE" | cut -d'/' -f2)

helpers.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# https://github.com/lunarcloud/script-dialog
44
# LGPL-2.1 license
55

6+
# Variables set in init.sh and used here
7+
# shellcheck disable=SC2154
8+
69
#######################################
710
# Attempts to run a privileged command (sudo or equivalent)
811
# GLOBALS:
@@ -17,12 +20,12 @@
1720
# 0 if success, non-zero otherwise.
1821
#######################################
1922
function superuser() {
20-
if [ $NO_SUDO == true ]; then
23+
if [ "$NO_SUDO" == true ]; then
2124
(>&2 echo "${red}No sudo available!${normal}")
2225
return 201
2326
fi
2427

25-
if [ $SUDO_USE_INTERFACE == true ]; then
28+
if [ "$SUDO_USE_INTERFACE" == true ]; then
2629
ACTIVITY="Enter password to run \"$*\""
2730
password "$@" | sudo -p "" -S -- "$@"
2831
elif [[ "$SUDO" == *"pkexec"* ]]; then
@@ -50,8 +53,10 @@ function superuser() {
5053
#######################################
5154
function _calculate-gui-title() {
5255
if [ -n "$ACTIVITY" ]; then
56+
# shellcheck disable=SC2034 # GUI_TITLE is used by other functions
5357
GUI_TITLE="$ACTIVITY - $APP_NAME"
5458
else
59+
# shellcheck disable=SC2034
5560
GUI_TITLE="$APP_NAME"
5661
fi
5762
}
@@ -110,7 +115,9 @@ function _calculate-tui-size() {
110115

111116
# Handle empty string case
112117
if [ -z "$TEST_STRING" ]; then
118+
# shellcheck disable=SC2153 # MIN_COLS and MIN_LINES are defined in init.sh
113119
RECMD_COLS=$MIN_COLS
120+
# shellcheck disable=SC2153
114121
RECMD_LINES=$MIN_LINES
115122
return
116123
fi
@@ -166,10 +173,12 @@ function _calculate-tui-size() {
166173
# Enforce maximum constraints
167174
if [ "$RECMD_LINES" -gt "$MAX_LINES" ] ; then
168175
RECMD_LINES=$MAX_LINES
176+
# shellcheck disable=SC2034 # RECMD_SCROLL is used by dialog functions
169177
RECMD_SCROLL=true
170178
fi
171179
if [ "$RECMD_COLS" -gt "$MAX_COLS" ]; then
172180
RECMD_COLS=$MAX_COLS
181+
# shellcheck disable=SC2034
173182
RECMD_SCROLL=true
174183
fi
175184

init.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# https://github.com/lunarcloud/script-dialog
44
# LGPL-2.1 license
55

6+
# Disable SC2034 for the entire file as variables defined here are used by scripts that source this library
7+
# shellcheck disable=SC2034
8+
69
# Disable this rule, as it interferes with purely-numeric parameters
710
# shellcheck disable=SC2046
811

@@ -158,6 +161,7 @@ fi
158161
# Variables
159162
################################
160163

164+
# These variables are intentionally exposed for use by scripts that source this library
161165
APP_NAME="Script"
162166
ACTIVITY=""
163167
GUI_TITLE="$APP_NAME"

inputs.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# https://github.com/lunarcloud/script-dialog
44
# LGPL-2.1 license
55

6+
# Variables set in init.sh and used here
7+
# shellcheck disable=SC2154
8+
69
#######################################
710
# Display a text input box
811
# GLOBALS:
@@ -48,7 +51,7 @@ function inputbox() {
4851
INPUT=$(dialog --clear --backtitle "$APP_NAME" --title "$ACTIVITY" --inputbox "${SYMBOL} $1" "$RECMD_LINES" "$RECMD_COLS" "$2" 3>&1 1>&2 2>&3)
4952
exit_status=$?
5053
elif [ "$INTERFACE" == "zenity" ]; then
51-
INPUT="$(zenity --entry --title="$GUI_TITLE" $ZENITY_ICON_ARG "$GUI_ICON" ${ZENITY_HEIGHT+--height=$ZENITY_HEIGHT} ${ZENITY_WIDTH+--width=$ZENITY_WIDTH} --text="$1" --entry-text "$2")"
54+
INPUT="$(zenity --entry --title="$GUI_TITLE" "$ZENITY_ICON_ARG" "$GUI_ICON" ${ZENITY_HEIGHT+--height=$ZENITY_HEIGHT} ${ZENITY_WIDTH+--width=$ZENITY_WIDTH} --text="$1" --entry-text "$2")"
5255
exit_status=$?
5356
elif [ "$INTERFACE" == "kdialog" ]; then
5457
INPUT="$(kdialog --title "$GUI_TITLE" --icon "$GUI_ICON" --inputbox "$1" "$2")"
@@ -119,7 +122,7 @@ function userandpassword() {
119122
elif [ "$INTERFACE" == "dialog" ]; then
120123
mapfile -t CREDS < <( dialog --clear --backtitle "$APP_NAME" --title "$ACTIVITY" --insecure --mixedform "Login:" "$RECMD_LINES" "$RECMD_COLS" 0 "Username: " 1 1 "$SUGGESTED_USERNAME" 1 11 22 0 0 "Password :" 2 1 "" 2 11 22 0 1 3>&1 1>&2 2>&3 )
121124
elif [ "$INTERFACE" == "zenity" ]; then
122-
ENTRY=$(zenity --title="$GUI_TITLE" $ZENITY_ICON_ARG "$GUI_ICON" ${ZENITY_HEIGHT+--height=$ZENITY_HEIGHT} ${ZENITY_WIDTH+--width=$ZENITY_WIDTH} --password --username "$SUGGESTED_USERNAME")
125+
ENTRY=$(zenity --title="$GUI_TITLE" "$ZENITY_ICON_ARG" "$GUI_ICON" ${ZENITY_HEIGHT+--height=$ZENITY_HEIGHT} ${ZENITY_WIDTH+--width=$ZENITY_WIDTH} --password --username "$SUGGESTED_USERNAME")
123126
local exit_status=$?
124127
CREDS[0]=$(echo "$ENTRY" | cut -d'|' -f1)
125128
CREDS[1]=$(echo "$ENTRY" | cut -d'|' -f2)
@@ -182,6 +185,7 @@ function password() {
182185
GUI_ICON=$XDG_ICO_PASSWORD
183186
fi
184187
_calculate-gui-title
188+
# shellcheck disable=SC2034 # TEST_STRING is used by _calculate-tui-rows-cols
185189
TEST_STRING="${PASSWORD_SYMBOL}$1"
186190
_calculate-tui-size
187191

@@ -193,7 +197,7 @@ function password() {
193197
PASSWORD=$(dialog --clear --backtitle "$APP_NAME" --title "$ACTIVITY" --passwordbox "$1" "$RECMD_LINES" "$RECMD_COLS" 3>&1 1>&2 2>&3)
194198
exit_status=$?
195199
elif [ "$INTERFACE" == "zenity" ]; then
196-
PASSWORD=$(zenity --title="$GUI_TITLE" $ZENITY_ICON_ARG "$GUI_ICON" ${ZENITY_HEIGHT+--height=$ZENITY_HEIGHT} ${ZENITY_WIDTH+--width=$ZENITY_WIDTH} --password)
200+
PASSWORD=$(zenity --title="$GUI_TITLE" "$ZENITY_ICON_ARG" "$GUI_ICON" ${ZENITY_HEIGHT+--height=$ZENITY_HEIGHT} ${ZENITY_WIDTH+--width=$ZENITY_WIDTH} --password)
197201
exit_status=$?
198202
elif [ "$INTERFACE" == "kdialog" ]; then
199203
PASSWORD=$(kdialog --title="$GUI_TITLE" --icon "$GUI_ICON" --password "$1")

lists.sh

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
# https://github.com/lunarcloud/script-dialog
44
# LGPL-2.1 license
55

6+
# Variables set in init.sh and used here
7+
# shellcheck disable=SC2034 # line variable in read loops
8+
# shellcheck disable=SC2154
9+
610
#######################################
711
# Display a list of multiply-selectable items
812
# GLOBALS:
@@ -67,10 +71,13 @@ function checklist() {
6771

6872
local exit_status=0
6973
if [ "$INTERFACE" == "whiptail" ]; then
70-
mapfile -t CHOSEN_ITEMS < <( whiptail --clear --backtitle "$APP_NAME" --title "$ACTIVITY" $([ "$RECMD_SCROLL" == true ] && echo "--scrolltext") --checklist "${QUESTION_SYMBOL}$TEXT" $RECMD_LINES $RECMD_COLS "$NUM_OPTIONS" "$@" 3>&1 1>&2 2>&3)
74+
# shellcheck disable=SC2046 # Intentional word splitting for conditional argument
75+
mapfile -t CHOSEN_ITEMS < <( whiptail --clear --backtitle "$APP_NAME" --title "$ACTIVITY" $([ "$RECMD_SCROLL" == true ] && echo "--scrolltext") --checklist "${QUESTION_SYMBOL}$TEXT" "$RECMD_LINES" "$RECMD_COLS" "$NUM_OPTIONS" "$@" 3>&1 1>&2 2>&3)
7176
exit_status=$?
7277
elif [ "$INTERFACE" == "dialog" ]; then
73-
local DIALOG_OUTPUT=$(dialog --clear --backtitle "$APP_NAME" --title "$ACTIVITY" $([ "$RECMD_SCROLL" == true ] && echo "--scrolltext") --separate-output --checklist "${QUESTION_SYMBOL}$TEXT" $RECMD_LINES $RECMD_COLS "$NUM_OPTIONS" "$@" 3>&1 1>&2 2>&3)
78+
local DIALOG_OUTPUT
79+
# shellcheck disable=SC2046 # Intentional word splitting for conditional argument
80+
DIALOG_OUTPUT=$(dialog --clear --backtitle "$APP_NAME" --title "$ACTIVITY" $([ "$RECMD_SCROLL" == true ] && echo "--scrolltext") --separate-output --checklist "${QUESTION_SYMBOL}$TEXT" "$RECMD_LINES" "$RECMD_COLS" "$NUM_OPTIONS" "$@" 3>&1 1>&2 2>&3)
7481
exit_status=$?
7582
IFS=$'\n' read -r -d '' -a CHOSEN_LIST < <( echo "${DIALOG_OUTPUT[@]}" )
7683

@@ -94,9 +101,10 @@ function checklist() {
94101
shift
95102
shift
96103
done
97-
local ZENITY_OUTPUT=$(zenity --title "$GUI_TITLE" $ZENITY_ICON_ARG "$GUI_ICON" --height="${ZENITY_HEIGHT-512}" ${ZENITY_WIDTH+--width=$ZENITY_WIDTH} --list --text "$TEXT" --checklist --column "" --column "Value" --column "Description" "${OPTIONS[@]}")
104+
local ZENITY_OUTPUT
105+
ZENITY_OUTPUT=$(zenity --title "$GUI_TITLE" "$ZENITY_ICON_ARG" "$GUI_ICON" --height="${ZENITY_HEIGHT-512}" ${ZENITY_WIDTH+--width=$ZENITY_WIDTH} --list --text "$TEXT" --checklist --column "" --column "Value" --column "Description" "${OPTIONS[@]}")
98106
exit_status=$?
99-
IFS=$'|' read -r -d '' -a CHOSEN_LIST < <( echo $ZENITY_OUTPUT )
107+
IFS=$'|' read -r -d '' -a CHOSEN_LIST < <( echo "$ZENITY_OUTPUT" )
100108

101109
local CHOSEN_ITEMS=()
102110
for value in "${CHOSEN_LIST[@]}"
@@ -195,14 +203,16 @@ function radiolist() {
195203

196204
local exit_status=0
197205
if [ "$INTERFACE" == "whiptail" ]; then
198-
CHOSEN_ITEM=$( whiptail --clear --backtitle "$APP_NAME" --title "$ACTIVITY" $([ "$RECMD_SCROLL" == true ] && echo "--scrolltext") --radiolist "${QUESTION_SYMBOL}$TEXT" $RECMD_LINES $RECMD_COLS "$NUM_OPTIONS" "$@" 3>&1 1>&2 2>&3)
206+
# shellcheck disable=SC2046 # Intentional word splitting for conditional argument
207+
CHOSEN_ITEM=$( whiptail --clear --backtitle "$APP_NAME" --title "$ACTIVITY" $([ "$RECMD_SCROLL" == true ] && echo "--scrolltext") --radiolist "${QUESTION_SYMBOL}$TEXT" "$RECMD_LINES" "$RECMD_COLS" "$NUM_OPTIONS" "$@" 3>&1 1>&2 2>&3)
199208
exit_status=$?
200209
# For TUI interfaces, empty response indicates cancel
201210
if [ $exit_status -ne 0 ] || [[ -z "$CHOSEN_ITEM" ]]; then
202211
exit "$SCRIPT_DIALOG_CANCEL_EXIT_CODE"
203212
fi
204213
elif [ "$INTERFACE" == "dialog" ]; then
205-
CHOSEN_ITEM=$( dialog --clear --backtitle "$APP_NAME" --title "$ACTIVITY" $([ "$RECMD_SCROLL" == true ] && echo "--scrolltext") --radiolist "${QUESTION_SYMBOL}$TEXT" $RECMD_LINES $RECMD_COLS "$NUM_OPTIONS" "$@" 3>&1 1>&2 2>&3)
214+
# shellcheck disable=SC2046 # Intentional word splitting for conditional argument
215+
CHOSEN_ITEM=$( dialog --clear --backtitle "$APP_NAME" --title "$ACTIVITY" $([ "$RECMD_SCROLL" == true ] && echo "--scrolltext") --radiolist "${QUESTION_SYMBOL}$TEXT" "$RECMD_LINES" "$RECMD_COLS" "$NUM_OPTIONS" "$@" 3>&1 1>&2 2>&3)
206216
exit_status=$?
207217
# For TUI interfaces, empty response indicates cancel
208218
if [ $exit_status -ne 0 ] || [[ -z "$CHOSEN_ITEM" ]]; then
@@ -222,7 +232,7 @@ function radiolist() {
222232
shift
223233
shift
224234
done
225-
CHOSEN_ITEM=$( zenity --title "$GUI_TITLE" $ZENITY_ICON_ARG "$GUI_ICON" --height="${ZENITY_HEIGHT-512}" ${ZENITY_WIDTH+--width=$ZENITY_WIDTH} --list --text "$TEXT" --radiolist --column "" --column "Value" --column "Description" "${OPTIONS[@]}" 2>/dev/null)
235+
CHOSEN_ITEM=$( zenity --title "$GUI_TITLE" "$ZENITY_ICON_ARG" "$GUI_ICON" --height="${ZENITY_HEIGHT-512}" ${ZENITY_WIDTH+--width=$ZENITY_WIDTH} --list --text "$TEXT" --radiolist --column "" --column "Value" --column "Description" "${OPTIONS[@]}" 2>/dev/null)
226236
exit_status=$?
227237
# For GUI interfaces, empty response indicates cancel
228238
if [ $exit_status -ne 0 ] || [[ -z "$CHOSEN_ITEM" ]]; then

0 commit comments

Comments
 (0)