GNATPP(1)

πŸ“¦ version 2019, in ubuntu jammy

πŸ’… NAME πŸ’…

gnatpp β€” the Ada pretty-printer, bestie. It's from the ASIS Tools crew and it's literally here to make your Ada source look iconic. πŸŽ€


✨ SYNOPSIS ✨

gnatpp [options] {filename | -files filename} [gcc_switches]

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so picture this: gnatpp takes the source text of the Ada units you point it at and recreates it from GNAT's parse tree. Like, it rebuilds the whole thing from scratch, and while it's doing that it reformats the source according to all the many options below. The defaults? They're set up for the GNAT style guide, so if you just vibe with the defaults you're already serving looks. πŸ’–


🌸 OPTIONS 🌸

  • -A(0|1|2|3|4|5) β€” set alignment. All the alignments are set ON by default, so this is your "actually let me pick" button.
    • 0 β€” set the default for all the alignments OFF
    • 1 β€” align colons in declarations
    • 2 β€” align assignments in declarations
    • 3 β€” align assignments in assignment statements
    • 4 β€” align arrow delimiters in associations
    • 5 β€” align 'AT' keywords in component clauses
  • -a(L|U|M) β€” set attribute casing
    • L β€” lower case
    • U β€” upper case
    • M β€” mixed case (set as default)
  • -c(0|1|2|3|4) β€” comments layout
    • 0 β€” do not format comments
    • 1 β€” GNAT style comment line indentation (set as default)
    • 2 β€” standard comment line indentation
    • 3 β€” GNAT style comment beginning
    • 4 β€” reformat comment blocks
  • -clnnn β€” indentation level for continuation lines, nnn from 1 .. 9
  • -Dfile β€” set file as the dictionary file defining casing exceptions
  • -D- β€” do not use RM95-defined casing for predefined names, use casing defined by the -n parameter and dictionary file(s) instead
  • -e β€” do not set missed end/exit labels
  • -ff β€” put Form Feed after a pragma Page
  • -gnatecpath β€” the same as the GNAT -gnatec option
  • -innn β€” indentation level, nnn from 1 .. 9, the default value is 3
  • -Idir β€” the same as the GNAT -I option
  • -I- β€” the same as the GNAT -I- option
  • -k(L|U) β€” set keyword casing
    • L β€” lower case (set as default)
    • U β€” upper case
  • -l(1|2|3) β€” set construct layout
    • 1 β€” GNAT style layout (set as default)
    • 2 β€” compact layout
    • 3 β€” uncompact layout
  • -Mnnn β€” set maximum line length, nnn from 32 .. 256, the default value is 79
  • -n(D|U|L|M) β€” set name casing (for both defining and usage occurrences)
    • D β€” as declared (set as default)
    • U β€” all in upper case
    • L β€” all in lower case
    • M β€” mixed
  • -N β€” no tabulation in comments
  • -p(L|U|M) β€” (yes bestie, that's it, just the letters)
    • L β€” lower case
    • U β€” upper case
    • M β€” mixed case (set as default)
  • --RTS=dir β€” the same as the GNAT --RTS option
  • -Tnnn β€” do not use additional indentation level for case alternatives and variants if their number is nnn or more (the default value is 10)
  • -q β€” quiet mode 🀫
  • -v β€” verbose mode πŸ—£οΈ
  • -dd β€” progress indicator verbose mode
  • -w β€” warnings ON

πŸ“ Output file control πŸ“

  • -pipe β€” send the output into stdout
  • -o output_file β€” write the output into output_file. Give up if output_file already exists
  • -of output_file β€” write the output into output_file, overriding the existing file
  • -r β€” replace the argument source with the pretty-printed source and copy the argument source into filename.npp. Give up if filename.npp already exists.
  • -rf β€” replace the argument source with the pretty-printed source and copy the argument source into filename.npp, overriding the existing file
  • -rnb β€” replace the argument source with the pretty-printed source and do not create the back-up copy of the argument source

πŸ“ Input files πŸ“

  • filename β€” the name of the Ada source file to be reformatted. Wildcards are allowed. ✨
  • -files filename β€” the name of the text file containing a list of Ada source files to reformat

🧚 GCC switches 🧚

  • gcc_switches β€” Passed to gnatgcc as "-cargs gcc_switches".

πŸ‘‘ SEE ALSO πŸ‘‘

Documentation about the ASIS tools may be found in /usr/share/doc/asis-doc/ if the asis-doc package is installed. The reference documentation about ASIS is excluded due to license problems 😭, but may be found in various formats at http://libre.adacore.com/developers/documentation.


And that's the whole page, bestie β€” this one's from the Debian GNU/Linux crew, dated 2014-08-09, and it's part of ASIS Tools. Go make your Ada look gorgeous. πŸ’œβœ¨

πŸ“¦ where this page comes from