-
Notifications
You must be signed in to change notification settings - Fork 345
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
Add standard command-line flags #37
Conversation
VERSION.h: VERSION | ||
echo '// THIS FILE IS AUTOMATICALLY GENERATED' > VERSION.h | ||
echo '// Run `make VERSION.h` to update it after modifying VERSION.' >> VERSION.h | ||
xxd -i VERSION >> VERSION.h |
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.
can't really decide if this is better than just duplicating the version in the C file or not...
unfortunately there doesn't seem to be a good way to have the C preprocessor read from a file into a string
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 always side with no duplication of data.
e2b7f30
to
6b7f0ce
Compare
// THIS FILE IS AUTOMATICALLY GENERATED | ||
// Run `make VERSION.h` to update it after modifying VERSION. | ||
unsigned char VERSION[] = { | ||
0x30, 0x2e, 0x34, 0x2e, 0x30, 0x0a |
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.
lols
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 hate committing build artifacts but I don't know of a better way to handle this. The alternative is duplicate the version into the top of the C file. But then we need to maintain versions in sync in README/setup.py/dumb-init.c/debian changelog.
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 just thought the ascii byte representation was funny is all.
The five cases you put in your description I'd actually do under test. It sounds like a pain / duplication of data to do it like that, but its always been worth the cost to have the test suite tell me when I've derped up the messaging. Plus, even when it's doing what you meant to, often you only notice the output could be improved when you see it fully written out, under test. But that's just me. Looks good apart from that nit. |
Add standard command-line flags
no arguments
--help / -h
--version / -V
--verbose / -v
--single-child --verbose / -cv