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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Printing JSON document & printing error #145

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

jirihnidek
Copy link
Contributor

  • There were one edge case, when not only JSON document was printed to stdout, and some user input was required. This case happened, when user is member of more organizations and --organization was not specified using CLI option
  • Do not print error message, when no format is specified
  • When no --username/--password is specified and --format json is used, then do not ask for input, but print some error.

@jirihnidek jirihnidek force-pushed the jhnidek/fix_connect_format_json branch from 14a5197 to db4f870 Compare September 13, 2024 10:07
@jirihnidek jirihnidek changed the title fix: Print only JSON document in edge cases or print error fix: Printing JSON document & printing error Oct 4, 2024
Copy link
Collaborator

@subpop subpop left a comment

Choose a reason for hiding this comment

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

Just one small grammatical change to the error message string.

main.go Outdated
return fmt.Errorf("--password is required, when --username and machine-readable format are used")
}
if username == "" || password == "" {
return fmt.Errorf("--username/--password or --organization/--activation-key are required, when machine-readable format is used")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return fmt.Errorf("--username/--password or --organization/--activation-key are required, when machine-readable format is used")
return fmt.Errorf("--username/--password or --organization/--activation-key are required when a machine-readable format is used")

Minor grammatical changes to error message.

* There were one edge case, when not only JSON document was
  printed to stdout, and some user input was required.
  This case happened, when user is member of more organizations
  and --organization was not specified using CLI option
* Do not print error message, when no format is specified
* When no --username/--password is specified and --format json
  is used, then do not ask for input, but print some error.
@jirihnidek jirihnidek force-pushed the jhnidek/fix_connect_format_json branch from db4f870 to d4b496d Compare October 4, 2024 15:07
@subpop subpop merged commit e9f40a7 into main Oct 4, 2024
23 of 24 checks passed
@subpop subpop deleted the jhnidek/fix_connect_format_json branch October 4, 2024 16:00
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.

2 participants