VistaIOReportUsage(3)

πŸ’… VistaIOReportUsage(3) β€” the Library Functions Manual, but make it cute

okay bestie, so this is VistaIOReportUsage(3) from the Library Functions Manual, and it's literally the page that teaches your program how to ✨explain itself✨ to whoever's typing at it. Two functions, one very valid mission: tell the user what they're allowed to type. Let's get into it 🫢


✨ NAME ✨

VistaIOReportUsage, VistaIOReportValidOptions β€” report valid command line arguments

Like, they report the valid options. It's giving helpful. It's giving customer service. Periodt. πŸ’–


🌸 SYNOPSIS 🌸

#include <vistaio.h>

void VistaIOReportUsage (program, noptions, options, other_args)
       VistaIOStringConst program, other_args;
       int noptions;
       VistaIOOptionDescRec options[noptions];

void VistaIOReportValidOptions (noptions, options)
       int noptions;
       VistaIOOptionDescRec options[noptions];

copy that #include exactly bestie, don't freestyle it 😭


πŸŽ€ ARGUMENTS πŸŽ€

  • program β€” the program's name, fr fr. Usually you just pass argv[0] and call it a day.
  • noptions β€” how many entries are chillin' in that table of option descriptors.
  • options β€” the actual location of the table of option descriptors. Like, the whole table.
  • other_args β€” this one's a maybe. You can hand it a string describing any options your program accepts that AREN'T in the options table… or you can just pass NULL and let it be. Your call, main character. πŸ¦‹

πŸ’œ DESCRIPTION πŸ’œ

So VistaIOReportUsage prints info about how to use a program β€” straight to the standard error stream, no cap. First thing it does is print a line shaped like this:

Usage: program <options> other_args, where <options> includes:

The program argument fills in the program part of that line, and the other_args argument fills in the other_args part. And if your program accepts literally no options besides the ones described in the options table? Then other_args should be NULL. Simple as that. πŸ™ˆ

Then VistaIOReportUsage calls VistaIOReportValidOptions to print a lil summary of all the options described by noptions and options. Iconic teamwork, honestly.

Now VistaIOReportValidOptions β€” she's the one who prints a description of each option in a table of option descriptors. This description exists to advise a program user (that's the whole point, bestie). It tells you:

  • what keyword signals the option's presence in the command line
  • whether it's optional
  • how many values have to follow it
  • what type those values should be
  • what keywords may be used as values for the option
  • what default value(s) the option has

It'll also include any ``blurb'' string of help information it finds hanging out in the option's table entry. And yes β€” all of this goes to the standard error stream too. 🌈


πŸ‘‘ SEE ALSO πŸ‘‘

VistaIOParseCommand(3), VistaIOReportBadArgs(3), VistaIOoption(3)

go read those next, iykyk πŸ’…


⭐ AUTHOR ⭐

Art Pope <pope@cs.ubc.ca>

Adaption to vistaio: Gert Wollny <gw.fossdev@gmail.com>


and that's the whole vibe check βœ… β€” this was VistaIO Version 1.2.14, dated 24 April 1993, and yes we're still stanning a manual page older than most of the internet. nostalgic AND useful, we love to see it πŸ’–πŸŽ€πŸ¦‹