LIBXO(3)
β¨ LIBXO(3) β¨
okay bestie, buckle up π this is the manual page for libxo β Library Functions Manual β and it's literally the glow-up your command-line tool's output has been waiting for. We're talking xo_parse_args, xo_set_program, the whole vibe. iykyk. π¦
πΈ NAME πΈ
xo_parse_args, xo_set_program β detect, parse, and remove arguments for libxo π
π LIBRARY π
library βlibxoβ β yeah that's the one, she's the moment π
β¨ SYNOPSIS β¨
#include <libxo/xo.h>
int
xo_parse_args(int argc, char **argv);
int
xo_set_program(const char *name);
π DESCRIPTION π
okay so first up: the xo_parse_args() function is the one that handles your command-line arguments β and those are all documented over in xo_options(7), go peek. π
Here's the tea: the libxo-specific options get processed and removed from the argument list so that your calling application does not need to deal with them at all. like, they're handled, bye, not your problem anymore π«Ά. If everything goes well, you get a new value for argc back. If it goes badly? a message gets emitted and -1 is returned. π
argc = xo_parse_args(argc, argv);
if (argc < 0)
exit(EXIT_FAILURE);
and once you've called xo_parse_args(), your application can just carry on processing whatever arguments are left, totally normal, no drama β¨
now, the xo_set_program() function β this one sets the name of the program as it gets reported by functions like xo_failure(), xo_warn(), xo_err(), etc. π£ The program name gets initialized by xo_parse_args(), but if you call xo_set_program() later you can override that value. main character energy, honestly.
β οΈ important bestie: the value is not copied! so the memory you pass toxo_set_program()(andxo_parse_args()) must be maintained by the caller. do not let that memory ghost you, fr fr π
π SEE ALSO π
xo_emit(3)xo_options(7,)libxo(3)
π HISTORY π
The libxo library first appeared in FreeBSD 11.0. iconic behavior π
π AUTHORS π
libxo was written by Phil Shafer <phil@freebsd.org>. slay π
π ADDITIONAL DOCUMENTATION π
FreeBSD uses libxo version 1.7.5. Complete documentation can be found on github:
https://juniper.github.io/libxo/1.7.5/html/index.html
libxo lives on github as:
https://github.com/Juniper/libxo
The latest release of libxo is available at:
https://github.com/Juniper/libxo/releases
π HISTORY π
The libxo library was added in FreeBSD 11.0. (yes, we said it twice, it's that important bestie π)
βοΈ AUTHOR βοΈ
Phil Shafer
and that's the whole page, no cap π this beauty came out of Debian, dated November 17, 2020, and it's page LIBXO(3) of the manual β go forth and format your output gorgeously, bestie π¦β¨π
π¦ where this page comes from
- epel 9: libxo-devel 1.7.5-1.el9 Β· LicenseRef-Callaway-BSD
- fedora 43: libxo-devel 1.7.5-2.fc43 Β· LicenseRef-Callaway-BSD
- fedora 43: libxo-devel 1.7.5-2.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: libxo-devel 1.7.5-3.fc44 Β· LicenseRef-Callaway-BSD
- fedora 44: libxo-devel 1.7.5-3.fc44 Β· LicenseRef-Callaway-BSD
- nixpkgs unstable: libxo 1.7.5
- Copyright (c) 2014, Juniper Networks, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms