Skip to content

demo(18): fix command substitution bug; add --listfonts and --verbose sections#7

Open
dan-snelson wants to merge 3 commits intoswiftDialog:mainfrom
dan-snelson:demo/18-misc-features
Open

demo(18): fix command substitution bug; add --listfonts and --verbose sections#7
dan-snelson wants to merge 3 commits intoswiftDialog:mainfrom
dan-snelson:demo/18-misc-features

Conversation

@dan-snelson
Copy link
Contributor

Summary

  • Bug fix: corrects $(${DIALOG} --version ...)$("$DIALOG" --version ...) in the --infotext value (unquoted variable in command substitution could break on paths with spaces)
  • Bug fix: removes local keyword from script-level exit_code=$? assignment (local is only meaningful inside functions)
  • Converts the Auth Key section from a dead-end to an intermediate step (Next → / Skip / || exit 0) so the demo can continue
  • Adds # --- List fonts --- section demonstrating --listfonts (output rendered in an --infobox)
  • Adds # --- Verbose mode --- section explaining --verbose usage

Test plan

  • zsh -n demos/18_misc_features.zsh passes silently (run as repo owner)
  • Run the demo; confirm --infotext shows the correct swiftDialog version string
  • Confirm Auth Key section advances with Next → / Skip
  • Confirm List Fonts section displays font names in the info box
  • Confirm Verbose Mode section renders and closes with "Done ✓"

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.
Copilot AI review requested due to automatic review settings February 25, 2026 11:41
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --infotext value
  • Removed incorrect local keyword from script-level variable assignment
  • Enhanced Auth Key section to continue demo flow instead of terminating
  • Added List Fonts section demonstrating --listfonts flag
  • Added Verbose Mode section explaining --verbose usage
  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants