No description
- Python 100%
| .gitignore | ||
| example.gif | ||
| getapi | ||
| LICENSE.txt | ||
| README.md | ||
getapi
A fast, lightweight CLI helper for instantly extracting and colorizing C/C++ API function declarations in your terminal.
Note
What
getapiis (and isn't):getapiis a quick command-line helper designed to help you rapidly wade through API "deserts" when onboarding or exploring C/C++ header files. It is not a full-fledged source-to-documentation tool (like Doxygen or Sphinx). Instead, it gives you a zero-config, terminal-native way to summarize, left-align, and visually group an API's function declarations in seconds.
✨ Features
- Left-Aligned Function Names: Converts traditional C prototypes (
int foo(int x)) into trailing return type syntax (foo(int x) -> int;), aligning function names cleanly along the left margin for effortless scanning. - Distinct Multi-Color Highlighting
- Automatic Namespace Detection: Automatically detects common C namespace conventions (
prefix_action) without requiring setup.
🚀 Quick Start
# Dump a clean, colorized API overview directly to standard output
./getapi path/to/header.h
# Explicitly specify custom library prefixes
./getapi -n mylib_ -n sys_ path/to/header.h
# Save colorized API summary to a file
./getapi -o api_summary.h path/to/header.h
📋 Sample Output
🛠️ Options
usage: getapi [-h] [-n NAMESPACE] [-o OUTPUT] [-v] [file]
Extract and syntax-highlight C/C++ API function declarations with ANSI escape
codes.
positional arguments:
file Path to raw C/C++ header file
options:
-h, --help show this help message and exit
-n, --namespace NAMESPACE
Namespace prefix to highlight (e.g. -n sds -n ini_ -n
parg_). Can be specified multiple times.
-o, --output OUTPUT Output file (default: stdout)
-v, -V, --version show program's version number and exit
