CB(1) — Silicon Graphics
NAME
cb − C program beautifier
SYNOPSIS
cb [ −s ] [ −j ] [ −l leng ] [ file ... ]
DESCRIPTION
Cb reads C programs either from its arguments or from the standard input and writes them on the standard output with spacing and indentation that displays the structure of the code. Under default options, cb preserves all user new-lines. Under the −s flag cb canonicalizes the code to the style of Kernighan and Ritchie in The C Programming Language. The −j flag causes split lines to be put back together. The −l flag causes cb to split lines that are longer than leng.
EXAMPLE
If there is a C program called test.c which looks like this:
#define COMING 1
#define GOING 0
main ()
{
/* This is a test of the C Beautifier */
if (COMING)
printf ("Hello, world\n");
else
printf ("Goodbye, world\n");
}
Then using the cb command as shown below produces the output shown:
cb test.c
#define COMING 1
#define GOING 0
main ()
{
/* This is a test of the C Beautifier */
if (COMING)
printf ("Hello, world\n");
else
printf ("Goodbye, world\n");
}
SEE ALSO
cc(1).
The C Programming Language by B. W. Kernighan and D. M. Ritchie.
BUGS
Punctuation that is hidden in preprocessor statements will cause indentation errors.
Version 2.3 — July 04, 1985