NAME¶
findent - Indents and optionally converts Fortran program source
SYNOPSIS¶
findent [OPTION]...
Findent reads from STDIN and writes to STDOUT.
DESCRIPTION¶
Findent indents a Fortran source. Findent uses various kinds of indentations,
see OPTIONS. Findent can convert from fixed form to free form, and can
supplement single END statements, see 'Refactor' below. Comment lines with '!'
in column one are not indented.
You can correct findent related indenting errors by inserting comment lines:
! findentfix: <fortran statement>
where <fortran statement> is for example DO, END, WHERE() etcetera.
Findent will adjust the indentation according to <fortran statement>.
Errors in OPTIONS are silently ignored.
General options:¶
Below: <n> denotes an unsigned decimal number. In the long options, you
can replace '_' with '-'.
- -h, --help
- print this text
- -H, --manpage
- print man page
- --readme
- print some background information
- -v, --version
- prints findent version
- -q, --query_fix_free
- guess free or fixed, prints 'fixed' or 'free' and exits
- -l<n>, --label_left=<n>
- (0/1) 1: move statement labels to start of line (default:1)
(only for free format)
- -lastindent, --last_indent
- prints computed indentation of last line
(for usage with vim)
- -lastusable, --last_usable
- prints line number of last line usable
as start for indenting(for usage with vim)
- -iauto, --input_format=auto
- determine automatically input format (free or fixed)
- -ifixed, --input_format=fixed
- force input format fixed (default: auto)
- -ifree, --input_format=free
- force input format free (default: auto)
- -i-, --indent=none
- do not change indent (useful in combination with -R)
- -L<n>, --input_line_length=<n>
- use only first <n> characters of each line default=0: take whole
lines
- -L<n>g, --input_line_length=<n>g
- same as above, but use gfortran convention for counting the characters
with tabbed lines
example: --input_line_length=72g
- -ofree, --output_format=free
- force free format output
- -osame, --output_format=same
- output format same is input format
- -Rr, --refactor_procedures
- refactor procedures and modules: a single 'end'
is, if possible, replaced by
'end subroutine <name>' or
'end function <name>' or
'end program <name>' or
'end blockdata <name>' or
'end module <name>'
where <name> is the name of the appropriate block
- -RR, --refactor_procedures=upcase
- same as -Rr, but 'SUBROUTINE' in stead of 'subroutine' etc
Indenting options:¶
- -I<n>, --start_indent=<n>
- starting indent (default:0)
- -Ia, --start_indent=a
- determine starting indent from first line
- -i<n>, --indent=<n>
- all indents except I,c,C,e (default: 3)
- -a<n>, --indent_associate=<n>
- ASSOCIATE indent
- -b<n>, --indent_block=<n>
- BLOCK indent
- -d<n>, --indent_do=<n>
- DO indent
- -f<n>, --indent_if=<n>
- IF indent
- -E<n>, --indent_enum=<n>
- ENUM indent
- -F<n>, --indent_forall=<n>
- FORALL indent
- -j<n>, --indent_interface=<n>
- INTERFACE indent
- -m<n>, --indent_module=<n>
- MODULE indent
- -r<n>, --indent_procedure=<n>
- FUNCTION and
SUBROUTINE indent
- -s<n>, --indent_select=<n>
- SELECT indent
- -t<n>, --indent_type=<n>
- TYPE indent
- -w<n>, --indent_where=<n>
- WHERE indent
- -x<n>, --indent_critical=<n>
- CRITICAL indent
- -C-, --indent_contains=restart,
- restart indent after CONTAINS
- -k<n>, --indent_continuation=<n>
- continuation indent except
for lines starting with '&'
free to free only
- -k-, --indent_continuation=none
- continuation lines not preceded
by '&' are untouched
free to free only
-
- next defaults are: all - all/2
- -c<n>, --indent_case=<n>
- CASE negative indent
- -C<n>, --indent_contains=<n>
- CONTAINS negative indent
- -e<n>, --indent_entry=<n>
- ENTRY negative indent
Usage with vim:¶
- --vim_help
- outputs directions to use findent in (g)vim
- --vim_fortran
- outputs file 'fortran.vim', see --vim_help
- --vim_findent
- outputs file 'findent.vim', see --vim_help
Usage with gedit:¶
- --gedit_help
- outputs directions to use findent in gedit
- --gedit_external
- outputs script 'findent-gedit', see --gedit_help
- --gedit_plugin
- outputs file 'findent.plugin', see --gedit_help
- --gedit_plugin_py
- outputs file 'python.py', see --gedit_help
Usage with emacs:¶
- --emacs_help
- outputs directions to use findent in emacs
- --emacs_findent
- outputs script 'findent.el', see --emacs_help
Examples:¶
indent: findent < in.f > out.f
findent -i2 -r0 < in.f > out.f convert: findent -ofree < prog.f >
prog.f90 refactor 'end': findent -Rr < in.f90 > out.f90
COPYRIGHT¶
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.