LIBXO(3)

πŸ“¦
version 1.7.5 Β· 2 versions
, in epel 9, fedora 43, fedora 44, nixpkgs unstable

✨ 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 to xo_set_program() (and xo_parse_args()) must be maintained by the caller. do not let that memory ghost you, fr fr πŸ’€

πŸ”— SEE ALSO πŸ”—

πŸ“œ 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