Skip to content

Fix misleading usage string in create-envfile.py#619

Open
Valyrian-Code wants to merge 1 commit into
GeoNode:masterfrom
Valyrian-Code:fix/create-envfile-usage-string
Open

Fix misleading usage string in create-envfile.py#619
Valyrian-Code wants to merge 1 commit into
GeoNode:masterfrom
Valyrian-Code:fix/create-envfile-usage-string

Conversation

@Valyrian-Code

Copy link
Copy Markdown
Contributor

Problem

The argparse usage string in create-envfile.py advertises a positional localhost:

usage="python create-envfile.py localhost -f /path/to/json/file.json"

but the parser only accepts the host via -hn/--hostname — there is no positional argument. So the documented invocation fails:

$ python create-envfile.py localhost
ENV file builder: error: unrecognized arguments: localhost

This wrong string is printed by --help and on every parse error, which is misleading at the very first setup step a new deployer hits.

Fix

Align the usage string with the actual interface (one line):

usage="python create-envfile.py -hn localhost -f /path/to/json/file.json"

Verification

  • python create-envfile.py --help now shows the corrected usage.
  • python create-envfile.py -hn localhost --noinput runs and generates .env (previously the documented positional form errored).

The argparse usage advertised a positional 'localhost', but the parser
only accepts the host via -hn/--hostname, so the documented invocation
'python create-envfile.py localhost' failed with
'unrecognized arguments: localhost'. Align the usage string with the
actual interface.
Copilot AI review requested due to automatic review settings June 9, 2026 20:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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