-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Depreacte --output-format, only allow --output option #2591
Conversation
src/options.c
Outdated
" -o --output=file.html|json|csv - Output either an HTML, JSON or a CSV file.\n" | ||
" -o --output=<filename|format> - Output to stdout or the specificed file.\n" | ||
" Currently support HTML, JSON and CSV format.\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update:
Now I know -o file.csv
will save the output to a file, while -o csv
will directly display it in the terminal.
It's currently not included in the help message. 😅
I need your assistance in improving the proposed wording, thanks. 🙇♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we can include a third line to show both options, and a brief example, like the one you posted above, would suffice. Thanks!
I still not confident about how to write the text with short word. Here is some version (with inspiration of ChatGPT), which one would you preferred?
|
Thanks for posting these options. Let's roll with G; I think that's pretty clear, in my opinion. |
Thanks, Sean! The changes have been merged. |
Current situation
-o --output=file.html|json|csv
- Output either an HTML, JSON or a CSV file."-o
(and the deprecated--output-format
), it will trigger read_option_args: case 'o'valid_output_type
first, then stores it tooutput_formats
.--output
, it will trigger parse_long_opt: "output"output_formats
directly.The bug I encountered
While using
--output out.tsv
, it runs through the parsing process and has no output file.When changed to
-o out.tsv
for short, it finally gives me the "invalid filename extension" error.Refer to commit history
--output=file.[html|csv|json]
as a shortcut to--output-format
output-format
tooutput
in README.--output-format
in this repo (exceptsrc/options.c
) is removed.valid_output_type()
to validate the filename given via-o
-o
(--output-format
), and the PR author forgot about--output
.According to the commit history, we can see that
--output-format
has been replaced for 6+ years. I think it's safe to remove it without any warning.So after this PR is merged,
--output-format
will only output a fatal error, saying it's deprecated, without backward compatibility.