demo(18): fix command substitution bug; add --listfonts and --verbose sections#7
Open
dan-snelson wants to merge 3 commits intoswiftDialog:mainfrom
Open
demo(18): fix command substitution bug; add --listfonts and --verbose sections#7dan-snelson wants to merge 3 commits intoswiftDialog:mainfrom
dan-snelson wants to merge 3 commits intoswiftDialog:mainfrom
Conversation
Signed-off-by: Dan K. Snelson <24623109+dan-snelson@users.noreply.github.com>
Bug fix: line 28 used $(${DIALOG} --version ...) — the inner variable
was unquoted. Corrected to $("$DIALOG" --version ...).
Style fixes: removed local keyword from exit_code assignment (not
inside a function); added jq fallback to the alwaysreturninput output.
New sections matching the header:
- '--- List fonts ---': runs --listfonts and shows output in infobox
- '--- Verbose mode ---': explains --verbose as a stderr debug flag
Auth key section now uses || exit 0 so new sections are reachable.
There was a problem hiding this comment.
Pull request overview
This PR fixes two bugs in demo 18 and enhances it with two new feature demonstrations. The command substitution bug could have caused failures when the dialog binary path contains spaces, and the local keyword was incorrectly used at script scope. The PR also improves the demo flow by converting the Auth Key section from a dead-end to a proper intermediate step and adds demonstrations for --listfonts and --verbose flags.
Changes:
- Fixed command substitution quoting bug in
--infotextvalue - Removed incorrect
localkeyword from script-level variable assignment - Enhanced Auth Key section to continue demo flow instead of terminating
- Added List Fonts section demonstrating
--listfontsflag - Added Verbose Mode section explaining
--verboseusage - Added comprehensive .gitignore file for macOS and Zsh artifacts
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| demos/18_misc_features.zsh | Fixed quoting and scoping bugs; added --listfonts and --verbose demonstrations; improved demo flow |
| .gitignore | Added comprehensive ignore patterns for macOS, Zsh, and project-specific temporary files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
$(${DIALOG} --version ...)→$("$DIALOG" --version ...)in the--infotextvalue (unquoted variable in command substitution could break on paths with spaces)localkeyword from script-levelexit_code=$?assignment (localis only meaningful inside functions)Next →/Skip/|| exit 0) so the demo can continue# --- List fonts ---section demonstrating--listfonts(output rendered in an--infobox)# --- Verbose mode ---section explaining--verboseusageTest plan
zsh -n demos/18_misc_features.zshpasses silently (run as repo owner)--infotextshows the correct swiftDialog version string