Skip to content

fix(cli): raise error for unrecognized root flags like --group#207

Open
panther-0707 wants to merge 1 commit into
sugar-org:mainfrom
panther-0707:fix/unrecognized-group-argument-206
Open

fix(cli): raise error for unrecognized root flags like --group#207
panther-0707 wants to merge 1 commit into
sugar-org:mainfrom
panther-0707:fix/unrecognized-group-argument-206

Conversation

@panther-0707

@panther-0707 panther-0707 commented Mar 24, 2026

Copy link
Copy Markdown

Description

Fixes #206

Previously, passing an unknown flag such as --group before a
subcommand would silently break out of the argument parsing loop
in extract_root_config(). This caused Sugar to fall back to
environment variable defaults, affecting unintended containers
with no warning shown to the user.

Changes

  • Added a check in extract_root_config() for unrecognized flags
    starting with --
  • Shows a clear error message suggesting --profile as the correct
    parameter
  • Exits with code 1 immediately

How to Test

sugar --group dev compose down
# Expected: Error: '--group' is not a valid parameter. 
# Did you mean '--profile'?

Pull Request checklist

  • bug-fix
  • new feature
  • maintenance

@github-actions

Copy link
Copy Markdown

This pull request has been marked as stale because it has been
inactive for more than 30 days. Please update this pull request
or it will be automatically closed soon.

@github-actions github-actions Bot added the stale label Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sugar compose accepts --group instead of --profile` silently, causing unintended environment takedowns

1 participant