-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
✨ zx: add --output
option
#499
Conversation
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.
LGTM aside from 1 nitpick.
@FineFindus oh and the CI is failing. |
Oh, looks like that's unrelated to your commits. Please rebase on current main and it should be fine. Windows one might need a rerun though. For some reason, the pkg-config download from sourceforge fails often. 🤷 |
24faf2b
to
7be02d9
Compare
7be02d9
to
3e37a76
Compare
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.
Are the double shortlogs in the last commit on purpose?
✨ zx: add split interfaces option
♻️ zx: clone service and path
3e37a76
to
7955d94
Compare
No real reason, just git deciding to add it automatically when squashing and me not noticing :). Fixed it. |
Thanks! but could you add some description there? Feel free to c&p the PR description. |
7955d94
to
9de0643
Compare
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 also now notice an inconsistency here. Normally the generated code is just thrown on the console, except (now) when --split-interfaces
is specified. Perhaps, it'd be better and we make --split-interfaces
implied by default? We can add a different option --output
(short form: -o
) to output to a specific file. If user specifies -o -
, we output everything to the stdout. This will also be consistent with how other tools (e.g gdbus) work I think. WDYT?
Frankly, I'm not a big fan of creating a bunch of files without explicit user permission. This is especially the case when you accidentally run the command (e.g. to try something out) and now have to clean up all the newly created files. |
|
That's not our problem to solve really. They could run the command accidently with
What's |
9c69511
to
b2edf5e
Compare
--split-interfaces
option--output
option
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.
The default behavior is changing here (which is a pretty big change and I'd like to see it hilighted) and the commit log summary doesn't capture it. It would be best to split the behavior change into a separate commit that comes before this one.
32b368d
to
bbb723e
Compare
Adds a new `--output` option. If a path is given with it, all the output is written to the file. If `-`, or any other argument, including nothing is given, the generated code is redirected to stdout
If the `--output` argument is omitted, the interfaces are split into individual files.
bbb723e
to
e1ee7ac
Compare
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.
As I wrote in the PM:
you did things the other way around. :(
the change of behavior still doesn't get hilighted in the commit history
I suggested that you first change the behavior so output is no longer sent to stdout but to separate interface files, and then add the -o so user can modify (including - for getting the old behavior)
but oh well
I'll just have to try hard and remember when writing the release notes
Adds a new
-output
option with three different behaviors:-
is given, the generated code is redirected to stdout