SHTK_CONFIG_HAS(3)

πŸ“¦ version 1.7, in nixos 26.05, nixpkgs unstable

πŸ’– NAME πŸ’–

okay so bestie, this is SHTK_CONFIG_HAS(3), from the Library Functions Manual β€” manual name folded in right here like a little name tag, no cap. It's the page for shtk_config_has, and it checks if a configuration variable is set. that's the assignment. πŸ’…

🧚 LIBRARY 🧚

you get this function by importing the config library. the line is literally:

shtk_import config? Wait, exact: shtk_import config β€” yes, that one. 🫢

✨ SYNOPSIS ✨

shtk_config_has var_name

just pass var_name and go. short, sweet, iconic. πŸŽ€

πŸ¦‹ DESCRIPTION πŸ¦‹

so the shtk_config_has function checks whether the configuration variable var_name has been previously set β€” either by a call to shtk_config_set(3) inside the script, or by the user in the configuration file. that's the vibe check it performs. 🌸

and the part that's genuinely highkey smart: shtk_config_has properly distinguishes between a variable that has never been defined and a variable that has been defined to the empty value. not me being obsessed with this level of emotional intelligence 😭. it does not blur those two cases together. πŸ’œ

🌈 RETURN VALUES 🌈

  • 0 (true) β€” when var_name has been defined. slay. ✨
  • 1 (false) β€” otherwise. πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

go read those if you're in your lore era. iykyk. πŸ”₯

πŸŽ€ HISTORY πŸŽ€

shtk_config_has first appeared in shtk 1.0. iconic from day one, fr fr. πŸ¦‹


mwah πŸ’‹ β€” this little page came from Debian, dated November 6, 2014, and it's filed under SHTK_CONFIG_HAS(3). that's the source/version-and-date sign-off, periodt. πŸ“

πŸ“¦ where this page comes from