Simplifies reading battery info from scripts.
Details
- Reviewers
allanjude kevans arichardson phil debdrup pauamma_gundo.com - Group Reviewers
Contributor Reviews (src) manpages
- Ensured text output is the same before and after libxo support.
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 39669 Build 36558: arc lint + arc unit
Event Timeline
Looks good. You can use {L:} for strings that include slashes by escaping them with double backslashes (one for C, one for me):
xo_emit("{Lc:Warn\\/full granularity}{P:\t}{:granularity-wf/%d}{Uw:/%sh}\n", ...
Thanks,
Phil
FYI: I've just added docs for this, so it will be in the next release, which I'll import shortly, but the functionality's already there.
Thanks,
Phil
xo_errx doesn't return; no further calls are needed/possible.
FWIW xo_errx() calls xo_finish() before calling exit().
Thanks,
Phil
However if you don’t encounter any errors you still need to run xo_finish(3).
- Cameron
Well, retest to ensure I'm not lying, but I just verified it as working in libxo/develop and even added an explicit test case for it, as well as docs.
Thanks,
Phil
usr.sbin/acpi/acpiconf/acpiconf.c | ||
---|---|---|
248 | You don't check the return value of argc here. Do you need to? |
usr.sbin/acpi/acpiconf/acpiconf.c | ||
---|---|---|
248 | I checked quite a few bins and it seems that most check argc. |
Yes, you need to check it. See xo_parse_args(3):
On failure, a message it emitted and -1 is returned. argc = xo_parse_args(argc, argv); if (argc < 0) exit(EXIT_FAILURE);
Cameron,
You said "it seems that most check"; did you find ones that didn't?
Thanks,
Phil
Sorry to bother, but was just wondering if someone could review this as it's been stale for a while.
Looks good. I do see an error on this site that says some nameless file is missing a terminating newline.
Thanks,
Phil
usr.sbin/acpi/acpiconf/acpiconf.8 | ||
---|---|---|
100 | Since you're touching this area. |
Sorry for the delay.
Thanks,
Phil
usr.sbin/acpi/acpiconf/acpiconf.8 | ||
---|---|---|
55 | Refer to xo_options(7) instead, since it's user-level documentation, rather than programmer level. | |
108 | ditto; hmm... maybe I should write a user-level version of libxo(3). | |
usr.sbin/acpi/acpiconf/acpiconf.c | ||
248 | Yes, you should be checking xo_parse_args return, so that you catch invalid arguments: argc = xo_parse_args(argc, argv); if (argc < 0) exit(EXIT_FAILURE); |
usr.sbin/acpi/acpiconf/acpiconf.8 | ||
---|---|---|
55 | Wow, can't believe I never knew that page existed. All other programs with libxo seem to reference xo_parse_args(3)... |
usr.sbin/acpi/acpiconf/acpiconf.8 | ||
---|---|---|
55 | Okay. I'll check and correct as needed. Thanks, |