CPPI(1)

πŸ“¦
version 1.18 Β· 4 versions
, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

πŸ’– CPPI(1) β€” the cppi page, but make it cute πŸ’–

okay bestie, so this is the manual page for cppi, living in the User Commands section of the manual. she's a little C-preprocessor-directive indenter and she is so underrated. let's get into it ✨


🌸 NAME 🌸

cppi β€” indent the C preprocessor directives in FILE to reflect their nesting πŸͺ†


πŸŽ€ SYNOPSIS πŸŽ€

cppi [FILE]
cppi -c [OPTION] [FILE]...

✨ DESCRIPTION ✨

Indent the C preprocessor directives in FILE so they actually reflect their nesting, and make sure there's exactly one space character between each #if, #elif, #define directive and the following token β€” then write the whole thing to standard output. πŸ’…

The number of spaces between the # and the following directive has to correspond to the level of nesting of that directive. like, that's the whole vibe check.

With no FILE, or when FILE is -, read standard input. 🫢

  • -a, --ansi β€” when checking, fail if text follows #else or #endif
  • -c, --check β€” set exit code, but don't produce any output
  • -l, --list-files-only β€” don't generate diagnostics about indentation; print to stdout only the names of files that are not properly indented
  • -m, --max-string-length=LENGTH β€” fail if there is a double-quoted string longer than LENGTH; if LENGTH is 0 (the default), then there is no limit
  • --help β€” display this help and exit
  • --version β€” output version information and exit

With the -c option, don't write to stdout. Instead, check the indentation of the specified files, giving diagnostics for preprocessor lines that aren't properly indented or are otherwise invalid. πŸ”

⚠️ heads up bestie: note that --ansi without --check does not correct the problem of non-ANSI text following #else and #endif directives. she sees it, she does not fix it, that's just her brand 😭

The exit code will be one of these:

  • 0 β€” all directives properly indented πŸ‘‘
  • 1 β€” some cpp directive(s) improperly indented, or text follows #else/#endif (enabled with --check --ansi), or a double-quoted string is longer than the specified maximum πŸ’€
  • 2 β€” #if/#endif mismatch, EOF in comment or string 🚨
  • 3 β€” file (e.g. open/read/write) error πŸ™ˆ

A pragma directive may have its # indented. 🧚


🌈 AUTHOR 🌈

Written by Jim Meyering. πŸ’œ


πŸ¦‹ REPORTING BUGS πŸ¦‹

Report bugs to <bug-cppi@gnu.org>. πŸ“ (yes, actually email the bugs, they wanna hear about them)


Copyright Β© 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law. 😀


⭐ SEE ALSO ⭐

The full documentation for cppi is maintained as a Texinfo manual. If the info and cppi programs are properly installed at your site, the command

info cppi

should give you access to the complete manual. 🫢


and that's the whole page, bestie!! this is cppi 1.18, from March 2013 β€” yeah she's an elder but she's still iconic, no cap. now go indent something and slay πŸ’…βœ¨πŸ‘‘

πŸ“¦ where this page comes from