Skip to content

docs: improve CLI pass-through argument documentation for Windows (#1336) - #1530

Merged
GitToTheHub merged 1 commit into
apache:masterfrom
rishi919-rgb:fix-windows-cli-passthrough-args
Oct 11, 2026
Merged

GitToTheHub merged 1 commit into
apache:masterfrom
rishi919-rgb:fix-windows-cli-passthrough-args

Conversation

@rishi919-rgb

@rishi919-rgb rishi919-rgb commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Platforms affected

Documentation / CLI (All platforms, specifically Windows Command Prompt and PowerShell, Android, iOS)

Motivation and Context

Fixes #1336

On Windows using Command Prompt or PowerShell, passing platform-specific arguments using the intermediate -- separator requires enclosing the -- in quotation marks ("--"). Without quotes, PowerShell throws syntax/parse errors or treats -- as a parameter terminator, leading to argument forwarding failures (as reported in apache/cordova-android#1671).

Description

  • Changed articles
    • CLI Guide: docs/en/latest/guide/cli/index.md
    • Android Platform Guide: docs/en/latest/guide/platforms/android/index.md
    • iOS Platform Guide: docs/en/latest/guide/platforms/ios/index.md

Following reviewer feedback:

  • Standard CLI examples across Android, iOS, and the CLI guide continue to use the standard unquoted -- separator (Unix/macOS).
  • Added explicit, dedicated notes for Windows users explaining that on Windows (Command Prompt and PowerShell), the -- separator must be enclosed in quotation marks ("--"), with accompanying examples.
  • Added a dedicated "Passing Platform-Specific Arguments" subsection in the Cordova CLI guide (guide/cli/index.md) with concrete examples for Android (Gradle parameters, signing / packageType) and links to platform guides.

Testing

  • Executed npm test (npm run lint), passing with 0 errors.
  • Verified Markdown syntax and links across modified documentation files.

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@GitToTheHub

Copy link
Copy Markdown
Contributor

I would leave the documentation examples to use just -- and note, that these are Unix/macOS examples. A note can be added, that on Windows the -- has to be enclosed in quotation marks. Giving Unix/macOS users more verbosed samples than necessary is also not a good solution.

@rishi919-rgb
rishi919-rgb force-pushed the fix-windows-cli-passthrough-args branch from 2a20840 to 7ae7767 Compare September 26, 2026 11:17
@rishi919-rgb

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback @GitToTheHub! That makes complete sense.

I have updated the changes accordingly:

  • Kept the standard CLI examples using the clean, unquoted -- separator (Unix/macOS).
  • Added dedicated notes specifically clarifying that on Windows (Command Prompt and PowerShell), the -- separator must be enclosed in quotation marks ("--"), with accompanying Windows examples.

The commit has been amended and force-pushed.

Comment thread www/docs/en/latest/guide/cli/index.md Outdated
Comment thread www/docs/en/latest/guide/platforms/android/index.md Outdated
Comment thread www/docs/en/latest/guide/platforms/android/index.md Outdated
Comment thread www/docs/en/latest/guide/platforms/android/index.md Outdated
Comment thread www/docs/en/latest/guide/platforms/android/index.md
Comment thread www/docs/en/latest/guide/platforms/android/index.md Outdated
Comment thread www/docs/en/latest/guide/platforms/ios/index.md
Comment thread www/docs/en/latest/guide/platforms/android/index.md Outdated
@rishi919-rgb
rishi919-rgb force-pushed the fix-windows-cli-passthrough-args branch from 7ae7767 to 9cf359a Compare September 27, 2026 12:45
@rishi919-rgb

Copy link
Copy Markdown
Contributor Author

Thanks again for the thorough review and helpful suggestions @GitToTheHub!

I have updated the PR to incorporate all of your feedback:

  • **\guide/cli/index.md**: Removed the platform guide links from the Windows note blockquote and added them under See Also: (linking Android to \index.html\ like iOS).
  • **\platforms/android/index.md**:
    • Replaced verbose explanation notes with direct **Example (Windows):\ code blocks alongside **Example (Unix/macOS):\ across the --gradleArg, --jvmargs, and signing sections.
    • Clarified the environment variable example header to **Example (Unix/macOS):**.
  • \platforms/ios/index.md**: Updated the example header to **Example (Unix/macOS):\ and removed the unnecessary Windows note.

The commit has been amended and force-pushed.

@GitToTheHub GitToTheHub left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi I found one thing which should be changed. Also there exists a Cordova Command-line-interface (CLI) Commands article, which is generated from apache/cordova-cli/doc/readme.md. This should be changed accordingly.

**Example (Windows):**

```bash
cordova build android "--" --jvmargs='-Xmx4g'

@GitToTheHub GitToTheHub Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The Windows JVM example uses single quotes. Command Prompt passes those quotes literally, so Cordova writes '-Xmx4g' into org.gradle.jvmargs, producing an invalid JVM argument. Use double quotes, which work in both Windows shells.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated to double quotes (\-Xmx4g\) so it works across both Command Prompt and PowerShell without passing literal single quotes.

@GitToTheHub

Copy link
Copy Markdown
Contributor

I added the articles you change in the description

…ache#1336)

- Keep standard CLI examples using unquoted -- separator
- Add dedicated notes explaining the quotation requirement ("--") for Windows (Command Prompt and PowerShell)
- Add Passing Platform-Specific Arguments section to the Cordova CLI guide with notes for Windows users
- Fixes apache#1336
@rishi919-rgb
rishi919-rgb force-pushed the fix-windows-cli-passthrough-args branch from 9cf359a to 8c7081d Compare October 11, 2026 09:02
@rishi919-rgb

Copy link
Copy Markdown
Contributor Author

Thanks @GitToTheHub!

  • Appreciate you updating the changed articles list in the description.
  • Rebased on latest master and updated the Windows JVM args example to use double quotes ("--jvmargs=\"-Xmx4g\"").
  • Regarding apache/cordova-cli/doc/readme.md: makes total sense. I can submit a companion PR over in apache/cordova-cli to update the -- pass-through notes and examples there as well.

@GitToTheHub

GitToTheHub commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Would be good if you could make a follow up PR on apache/cordova-cli

@GitToTheHub
GitToTheHub merged commit 5d0b664 into apache:master Oct 11, 2026
2 checks passed
@rishi919-rgb

Copy link
Copy Markdown
Contributor Author

Done! I've opened the follow-up PR on \�pache/cordova-cli\ here: apache/cordova-cli#735

@GitToTheHub

Copy link
Copy Markdown
Contributor

Nice, I will have a look on it

GitToTheHub pushed a commit to apache/cordova-cli that referenced this pull request Oct 11, 2026
…735)

This PR updates doc/readme.md (which generates the Cordova Command-line-interface (CLI) Commands documentation page on cordova.apache.org) to document Windows quoting requirements for the platform options pass-through separator (--)

Relates to issue apache/cordova-docs#1336 and follows up on PR apache/cordova-docs#1530.
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.

Improve CLI usage documentation on windows

2 participants