Skip to content

wpcc --help shows literal $SCRIPT_VERSION instead of version number #132

@mrtwebdesign

Description

@mrtwebdesign

Problem

Running wpcc --help (or check-performance.sh --help) displays:

VERSION:
  WP Code Check v$SCRIPT_VERSION

Should display:

VERSION:
  WP Code Check v2.0.14

Root cause

dist/bin/check-performance.sh line 405:

show_help() {
  cat << 'EOF'

The single quotes around EOF create a quoted heredoc, which tells bash to print everything literally without variable expansion. Line 508 contains $SCRIPT_VERSION but it's never expanded because of the quoting.

Fix

Change line 405 from:

  cat << 'EOF'

to:

  cat << EOF

This allows $SCRIPT_VERSION (defined at line 78 as SCRIPT_VERSION="2.0.14") to be expanded in the help text output.

Note: When removing the quotes, check that the rest of the heredoc doesn't contain other $ characters that would be unintentionally expanded. A quick scan shows no other $ references in the help text block (lines 406-509), so this change is safe.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions