explain_program_name(3)
π explain_program_name(3) β Library Functions Manual π
okay bestie, sit down, hydrate, and let me tell you about explain_program_name β it's the little trio of functions that mess with libexplain's whole idea of what your program is even called, and whether that name shows up in your error messages. lowkey iconic, highkey useful. β¨
π NAME π
explain_program_name β manipulate the program name π
πΈ SYNOPSIS πΈ
#include <libexplain/libexplain.h>
const char *explain_program_name_get(void);
void explain_program_name_set(const char *name);
void explain_program_name_assemble(int yesno);
π¦ DESCRIPTION π¦
so basically, these functions let you poke at libexplain's internal vibe check on the command name of the current process β and also decide whether that name gets included in error messages or not. three little functions, one big glow-up. π
β explain_program_name_get
const char *explain_program_name_get(void);
explain_program_name_get is your girl for grabbing the command name of the calling process. ngl, whether this actually gives you something sensible depends on how capable /proc is on your system β or, if that's not happening, how capable lsof(1) is on your system. on Linux? it works well. slay. β¨
Returns:
- pointer to string containing the command name (no slashes) of the calling process.
π explain_program_name_set
void explain_program_name_set(const char *name);
explain_program_name_set lets you tell the libexplain libraries what you think the command name of the calling process is β it sets the string that explain_program_name_get(3) will hand back. this overrides the automatic behavior, which is genuinely super desirable for commands that can get invoked under more than one name, e.g. if they're a hard link synonym. main character energy: you decide who you are. π
this also sets the option to include the program name in all of the error messages issued by the explain_*_or_die(3) functions.
- name β the name of the calling process. only the basename will be used if a path containing slashes is given.
π explain_program_name_assemble
void explain_program_name_assemble(int yesno);
explain_program_name_assemble is the control freak of the group β it decides whether or not the name of the calling process gets included in error messages issued by the explain_*_or_die(3) functions. if you don't set it explicitly, it's controlled by the EXPLAIN_OPTIONS environment variable, and if it's not set there either, it defaults to true.
- yesno β nonβzero (true) to have program name included, zero (false) to have program name excluded.
π COPYRIGHT π
libexplain version 1.4 Copyright (C) 2008 Peter Miller
π«Ά AUTHOR π«Ά
Written by Peter Miller <pmiller@opensource.org.au> π
and that's the whole page, bestie β explain_program_name(3) from libexplain version 1.4, with that 2008 Peter Miller copyright, straight out of the Library Functions Manual. periodt. π
πβ¨
π¦ where this page comes from
- debian bookworm: libexplain-dev 1.4.D001-12+b1 Β· LGPL-3.0-or-later
- debian trixie: libexplain-dev 1.4.D001-16 Β· LGPL-3.0-or-later
- ubuntu jammy: libexplain-dev 1.4.D001-12 Β· LGPL-3.0-or-later
- ubuntu noble: libexplain-dev 1.4.D001-13 Β· LGPL-3.0-or-later
- ubuntu resolute: libexplain-dev 1.4.D001-16 Β· LGPL-3.0-or-later
- Copyright (C) 2008-2011 Peter Miller
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms