Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix url parameter position #610

Merged
merged 5 commits into from
Dec 18, 2023
Merged

Fix url parameter position #610

merged 5 commits into from
Dec 18, 2023

Conversation

markushi
Copy link
Member

馃摐 Description

For some reason our cli is very picky about parameter position

sentry-cli --url https://myserver.invalid/ login # works

sentry-cli login --url https://myserver.invalid/ # fails

馃挕 Motivation and Context

Fixes #609

馃挌 How did you test it?

Added a unit test. In the long run it could make sense to have a base class ~BaseSentryCliTask, as we have similar logic spread out a few times already.

馃摑 Checklist

  • I reviewed the submitted code
  • I added tests to verify the changes
  • I updated the docs if needed
  • No breaking changes

馃敭 Next steps

Copy link
Member

@adinauer adinauer left a comment

Choose a reason for hiding this comment

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

LGTM

@adinauer
Copy link
Member

For some reason our cli is very picky about parameter position

That's because there's args for the main sentry-cli command and there's separate args for subcommands like login or debug-files (which in turn may have even more subcommands with their own args). So args have to be after the command they belong to but before the next subcommand.

The --url arg is part of the sentry-cli command itself, see https://github.com/getsentry/sentry-cli/blob/4e4a261dd998c655d3c97db285f4b214178fb666/src/commands/mod.rs#L145

@markushi markushi merged commit 123e7ac into main Dec 18, 2023
17 checks passed
@markushi markushi deleted the fix/invalid-url-param branch December 18, 2023 08:55
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.

error: unexpected argument '--url' found
2 participants