Skip to content

fix(cli): return undefined for empty inline -c= flag in findConfigFlag - #1574

Merged
sorccu merged 1 commit into
checkly:mainfrom
shafiktanbir:fix/find-config-flag-empty-short-inline
Oct 26, 2026
Merged

sorccu merged 1 commit into
checkly:mainfrom
shafiktanbir:fix/find-config-flag-empty-short-inline

Conversation

@shafiktanbir

Copy link
Copy Markdown
Contributor

Fixes #1571

In findConfigFlag (packages/cli/src/services/project-cli.ts), --config= returns arg.slice('--config='.length) || undefined without falling back to args[i + 1]. For -c= (or grouped short flags like -pc=), value was empty when nothing followed = and (value || args[i + 1]) fell back to the next positional argument or flag.

This returns arg.slice(j + 2) || undefined directly when arg[j + 1] === '=' so -c= matches --config= and oclif's parser behavior, and adds the corresponding test cases in project-cli.spec.ts.

@sorccu
sorccu enabled auto-merge (squash) October 26, 2026 14:31
@sorccu
sorccu disabled auto-merge October 26, 2026 14:32
@sorccu
sorccu merged commit b9dc87c into checkly:main Oct 26, 2026
1 check passed
@sorccu

sorccu commented Oct 26, 2026

Copy link
Copy Markdown
Member

Thanks! I was also able to improve my review workflow by asking it why it didn't catch the issue originally and applying a few recommendations. Appreciated.

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.

findConfigFlag consumes next CLI argument when -c= is passed with an empty value

2 participants