SDFAPI(1)
π SDFAPI β the API Extraction Utility, bestie edition π
Okay so like, this is sdfapi(1) from the User Contributed Perl Documentation, and it is literally the utility that pulls API info out of your source code. Main character energy fr fr.
β¨ NAME β¨
sdfapi β API Extraction Utility π«Ά
π― PURPOSE π―
sdfapi extracts Application Programming Interface information from (Perl) source code. That's it, that's the whole vibe. It looks at your code and goes "here's the API, you're welcome" π
π USAGE π
usage : sdfapi [-h[help]] [-o[out_ext]]
[-l[log_ext]] [-O[out_dir]] [-f fmt_tag]
[-p[pattern]] [-s sym_type,..] [-j]
file ...
purpose: extract the API from a (perl) library
version: 2.000 (SDF 2.001)
The options are:
Option Description
-h display help on options
-o output file extension
-l log file extension
-O output to input file's (or explicit) directory
-f output format tag
-p only symbols matching pattern
-s only symbols of these types
-j add SDF-style hypertext jumps from each symbol
πΈ DESCRIPTION πΈ
So the -h option gives you help. If you specify it with no parameter, you get a brief lil description of each option. But if you want the attributes for a specific option, just hand over the option letter as the parameter. Slay π
By default, the generated output goes to standard output. But if you want output going to a file per input file, use the -o option to specify an extension for your output files. And if you specify -o with no parameter, it just assumes an extension of out. Convenient, honestly.
Likewise, error messages go to standard error by default. Use the -l option to create a log file per input file instead. And if -l is specified without a parameter, an extension of log is assumed. Okay periodt π
By default, generated output files and log files get created in the current directory. Use the -O option to specify an explicit output directory. And if -O is specified without a parameter, the input file's directory is used. Iconic.
The format of the output can be controlled with the -f option. The supported formats are std and concise. The default is std. β¨
std format is:
require "abc.pl";
$myvar = ...
$result = &myfunc($myparams);
concise format has fewer blank lines and uses 1 line per symbol.
You can specify a comma-separated list of symbol types to output with the -s option. The supported symbol types are:
subβ subroutinesvarβ variables
The default is to extract all symbols. π
The -p option is used to extract only a subset of the symbols:
- If it's not supplied, the pattern is symbols beginning with a letter.
- If it's supplied without an option, the pattern defaults to all symbols.
- And if your perl libraries use the coding convention where symbols beginning with underscore are private, then you can use
-p_to extract the private symbols. iykyk π
The -j option requests SDF-style hypertext jumps be added for each symbol. The jump target is lib_sym, where:
libis the library namesymis the symbol name
π¦ LIMITATIONS AND FUTURE DIRECTIONS π¦
The only language currently supported is Perl. No cap.
It would be useful to extract messages from the scripts too. This would require a new utility called sdfmsg say, which searched through the source (including libraries) for AppMsg and AppExit calls. Someone get on that fr fr π
Internally, it may be better to implement formats via routines. This would give better control over output. e.g. it would be up to the routine to decide if it wanted to output the 'require' header.
Okay that's the whole page, bestie!! π This little love letter to API extraction came to you from perl v5.36.0, dated 2023-08-02, and it is so SDFAPI(1). Go extract some APIs, you absolute legend πβπ
π¦ where this page comes from
- debian trixie: sdf 2.001+1-9
- ubuntu noble: sdf 2.001+1-9
- ubuntu questing: sdf 2.001+1-9
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms