Skip to content

Fix getProjectID misinterpreting args when flags present without config#5

Merged
robzolkos merged 1 commit intorobzolkos:masterfrom
rmmcgr:fix/getprojectid-flag-misinterpretation
Mar 6, 2026
Merged

Fix getProjectID misinterpreting args when flags present without config#5
robzolkos merged 1 commit intorobzolkos:masterfrom
rmmcgr:fix/getprojectid-flag-misinterpretation

Conversation

@rmmcgr
Copy link
Copy Markdown

@rmmcgr rmmcgr commented Mar 3, 2026

When no .basecamp.yml config is found, getProjectID treated args[0] as project_id unconditionally. This caused misinterpretation when only a resource ID and flags were passed (e.g. basecamp cards 5437262823 --column "TRIAGE"), where the board_id would be consumed as project_id and the flag value became the board_id, resulting in 404 errors.

Add a minPositionalArgs parameter to getProjectID so each command declares how many positional args it expects besides project_id. When no config is found, count non-flag positional args (skipping --flag value pairs). If there aren't enough for both project_id and the command's required args, return a clear error instead of misinterpreting.

Fixes #3

Created with the assistance of Claude Code.

When no .basecamp.yml config is found, getProjectID treated args[0] as
project_id unconditionally. This caused misinterpretation when only a
resource ID and flags were passed (e.g. `basecamp cards 5437262823
--column "TRIAGE"`), where the board_id would be consumed as project_id
and the flag value became the board_id, resulting in 404 errors.

Add a minPositionalArgs parameter to getProjectID so each command
declares how many positional args it expects besides project_id. When no
config is found, count non-flag positional args (skipping --flag value
pairs). If there aren't enough for both project_id and the command's
required args, return a clear error instead of misinterpreting.

Fixes robzolkos#3
@robzolkos robzolkos merged commit f1159e7 into robzolkos:master Mar 6, 2026
1 check passed
@robzolkos
Copy link
Copy Markdown
Owner

@rmmcgr thanks!

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.

Commands with flags fail when .basecamp.yml provides project_id

2 participants