Skip to content

Arguments after -- separator are incorrectly parsed as atmos flags #1995

@kylan11

Description

@kylan11

Describe the Bug

Atmos does not correctly respect the -- argument separator. Arguments passed after -- (which should be forwarded directly to the underlying terraform/tofu command) are being parsed as POSIX-style short flags by atmos itself.
Atmos parses -concise as a series of single-character short flags: -c, -o, -n, -c, -i, -s, -e.

When it encounters -s, it interprets this as the --stack flag and takes e (the next character) as its value, resulting in:

Error: invalid component

Could not find the component <component> in the stack e.

No viable workaround atm short of downgrading to v1.201.x (the bug was introduced after this version, I haven't tested on 202 or 203).

Using --concise (double-dash) instead of -concise passes through atmos correctly, but tofu itself rejects it:

╷
│ Error: Failed to parse command-line flags
│ 
│ flag provided but not defined: -concise
╵

Expected Behavior

The -concise flag should be passed through to tofu plan without any parsing by atmos. The -- separator should stop all flag parsing.

Steps to Reproduce

atmos tofu plan <component> -s <stack> -- -concise

Screenshots

No response

Environment

  • Broken in: v1.204.0
  • Working in: v1.201.0

Additional Context

No response

Metadata

Metadata

Assignees

Labels

bug🐛 An issue with the system

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions