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

Messages about overriding content and/or version URLs on STDOUT spoil JSON output #1620

Open
bwarden opened this issue May 16, 2023 · 0 comments

Comments

@bwarden
Copy link
Member

bwarden commented May 16, 2023

If we override the content or version URLs using -u, -c, or -v, we print out a message on STDOUT warning about it:

case 'u':
print("Overriding version and content URLs with %s\n", optarg);
set_version_url(optarg);
set_content_url(optarg);
return true;
case 'P':
err = str_to_int(optarg, &globals.update_server_port);
if (err < 0 || globals.update_server_port < 0) {
error("Invalid --port argument: %s\n\n", optarg);
return false;
}
return true;
case 'c':
print("Overriding content URL with %s\n", optarg);
set_content_url(optarg);
return true;
case 'v':
print("Overriding version URL with %s\n", optarg);
set_version_url(optarg);
return true;

In most cases, this is probably fine. But if we've been given -j for JSON output, we really should only be outputting valid JSON strings. We should probably move these (and any other) warnings to STDERR.

This will likely affect test cases, too.

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

No branches or pull requests

1 participant