SDFCLI(1)

πŸ“¦
version 2.001+1 Β· 3 versions
, in debian trixie, ubuntu noble, ubuntu questing

πŸ’– SDFCLI ✨

okay bestie, so this is a User Contributed Perl Documentation situation β€” it lives in manual section 1 (that's the "run it in your shell" section, iykyk) and the whole vibe is: it takes a utility's command line interface and turns it into SDF. no cap. let's get into it. πŸŽ€


🌸 NAME 🌸

sdfcli β€” Command Line Interface Utility

like... the name is literally the description bestie, it's giving "I do exactly what my name says" πŸ’…


πŸ¦‹ PURPOSE πŸ¦‹

sdfcli extracts command line interface (CLI) information from applications and formats it into SDF.

periodt. that's the whole job. it goes and grabs the CLI info, and it makes it pretty SDF. πŸ’–


✨ USAGE ✨

 usage  : sdfcli [-h[help]] [-o[out_ext]]
         [-l[log_ext]] [-O[out_dir]] [-w wrap]
         utility ...
purpose: format a utility's command line interface into SDF
version: 2.000    (SDF 2.001)

The options are:

  • -h β€” display help on options
  • -o β€” output file extension
  • -l β€” log file extension
  • -O β€” output to input file's (or explicit) directory
  • -w β€” column at which to wrap option specifications

like okay that's the cheat sheet, but keep reading because the details are where it's at, fr fr 🌈


πŸ’… DESCRIPTION πŸ’…

The -h option provides help. If it is specified without a parameter, a brief description of each option is displayed. To display the attributes for an option, specify the option letter as a parameter.

so like β€” -h alone gives you the lil summary of everything, and -h with an option letter gives you the deep dive on that one option. it's giving "tell me more about this specific thing" energy. πŸ‘‘

By default, generated output goes to standard output. To direct output to a file per input file, use the -o option to specify an extension for output files. If the -o option is specified without a parameter, an extension of out is assumed.

so no -o = output just vibes onto stdout. with -o = one output file per input file. and if you're like "bestie I don't wanna pick a name" and give -o no parameter, it just goes "bet, out" πŸ“

Likewise, error messages go to standard error by default. Use the -l option to create a log file per input file. If the -l option is specified without a parameter, an extension of log is assumed.

same deal but for the messy stuff β€” errors default to standard error. -l gets you a log file per input file, and no parameter means the extension is log. the way that symmetry ate πŸ’€

By default, generated output and log files are created in the current directory. Use the -O option to specify an explicit output directory. If the -O option is specified without a parameter, the input file's directory is used.

default = current directory, always. -O lets you say "actually put it here" β€” and if you give -O no parameter, it uses the input file's directory. cute, lowkey convenient 🧚

sdfcli executes each argument with a -h flag and converts the resultant output to nicely formatted SDF. An argument of - specifies that the help should be read from standard input.

okay this is the main character move right here: it runs each thing you hand it with -h, grabs whatever comes back, and turns it into nicely formatted SDF. and if your argument is literally -, that means "read the help from standard input" β€” handy for piping, iykyk πŸ”₯

Formatting is done as follows:

  1. lines are tagged as Example paragraphs, with the first line formatted to wrap option usage specifications nicely
  2. if a line is found that starts with options:, it is replaced with a Body paragraph saying "The options are:", and the following lines are formatted as a table of codes and descriptions
  3. if a line is found that starts with aliases:, it is replaced with a Body paragraph saying "The aliases are:", and the following lines are formatted as a table of names and descriptions
  4. each option code in the table is formatted as a hypertext jump to a tag called cmd_opt where:
    • cmd is the command name
    • opt is the option code

The -w option specifies at what column to wrap option specifications. The default is 50 β€” this is the best for output imported into the Mincom templates.

fifty. five-zero. that's the default and it's the one that plays nicest with the Mincom templates, so like... don't fight it unless you have a reason, bestie 🫢


πŸ’€ LIMITATIONS AND FUTURE DIRECTIONS πŸ’€

The table formats used are hard coded.

yeah. that's it. that's the whole limitation. the table formats are hard coded β€” no config file, no vibes-based customization, just hard coded. we move. πŸ™ˆ


🌟 SEE ALSO 🌟

(ngl bestie there's no SEE ALSO section in this one β€” the page just ends after the limitations. no references, no friends, just sdfcli out here doing its thing solo. main character energy, literally. πŸ’œ)


heads up: the table formats being hard coded is a real limitation, not a cute quirk β€” don't go expecting to swap them out. that's just how it is for now.

that's the whole page, bestie!! written by the Perl docs crew, part of the User Contributed Perl Documentation collection, running under perl v5.36.0, and dated 2023-08-02. mwah. slay. go format some CLIs. βœ¨πŸ’–πŸŽ€

πŸ“¦ where this page comes from