.\" DO NOT MODIFY THIS FILE! It was created by findent \-H .TH FINDENT "1" "2019" "findent\-3.1.7" "User Commands" .SH NAME findent \- Indents and optionally converts Fortran program source .SH SYNOPSIS .B findent [\fIOPTION\fR]... .PP Findent reads from STDIN and writes to STDOUT. .SH 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: where is for example DO, END, WHERE() etcetera. Findent will adjust the indentation according to . Errors in OPTIONS are silently ignored. .PP .SS "General options: Below: denotes an unsigned decimal number. denotes a character. In the long options, you can replace '_' with '\-'. .TP \fB\-h, \-\-help\fR print this text .TP \fB\-H, \-\-manpage\fR print man page .TP \fB\-\-readme\fR print some background information .TP \fB\-v, \-\-version\fR prints findent version .TP \fB\-q, \-\-query_fix_free\fR guess free or fixed, prints 'fixed' or 'free' and exits .TP \fB\-\-continuation=\fR ' ': (default) do not change continuation characters '0': create numbered continuation characters other: use that continuation character default for conversion from free to fixed is '&' .TP \fB\-\-include_left=\fR (0/1) 1: indent include statements to starting indent (default:0) .TP \fB\-l, \-\-label_left=\fR (0/1) 1: move statement labels to start of line (default:1) (only for free format) .TP \fB\-lastindent, \-\-last_indent\fR prints computed indentation of last line (for usage with vim) .TP \fB\-lastusable, \-\-last_usable\fR prints line number of last line usable as start for indenting(for usage with vim) .TP \fB\-iauto, \-\-input_format=auto\fR determine automatically input format (free or fixed) .TP \fB\-ifixed, \-\-input_format=fixed\fR force input format fixed (default: auto) .TP \fB\-ifree, \-\-input_format=free\fR force input format free (default: auto) .TP \fB\-i\-, \-\-indent=none\fR do not change indent (useful in combination with \-R) .TP \fB\-L, \-\-input_line_length=\fR use only first characters of each line default=0: take whole lines .TP \fB\-Lg, \-\-input_line_length=g\fR same as above, but use gfortran convention for counting the characters with tabbed lines example: \-\-input_line_length=72g .TP \fB\-M, \-\-max_indent=\fR maximum output indent, default 100, 0: no limit .TP \fB\-ofixed, \-\-output_format=fixed\fR force fixed format output .TP \fB\-ofree, \-\-output_format=free\fR force free format output .TP \fB\-osame, \-\-output_format=same\fR output format same is input format .TP \fB\-\-openmp=\fR 0: do not indent openmp conditionals 1: indent openmp conditionals (default) NOTE: for free format, the omp sentinel must be '!$ ' .TP \fB\-Rr, \-\-refactor_procedures\fR refactor procedures and modules: the END line of a subroutine, program etc. is, if possible, replaced by 'end subroutine ' or 'end function ' or 'end procedure ' or 'end program ' or 'end block data ' or 'end module ' or 'end submodule ' where is the name of the appropriate procedure, subroutine etc. NOTE1: if the END line contains a continuation the results are undefined NOTE2: a line like 'end function fun' will be replaced by 'end subroutine sub' if the END line ends 'subroutine sub' .TP \fB\-RR, \-\-refactor_procedures=upcase\fR same as \-Rr, but 'END SUBROUTINE ' in stead of 'end subroutine ' etc. .PP .SS "Indenting options: .TP \fB\-I, \-\-start_indent=\fR starting indent (default:0) .TP \fB\-Ia, \-\-start_indent=a\fR determine starting indent from first line .TP \fB\-i, \-\-indent=\fR all indents except I,c,C,e (default: 3) .TP \fB\-a, \-\-indent_associate=\fR ASSOCIATE indent .TP \fB\-b, \-\-indent_block=\fR BLOCK indent .TP \fB\-d, \-\-indent_do=\fR DO indent .TP \fB\-f, \-\-indent_if=\fR IF indent .TP \fB\-E, \-\-indent_enum=\fR ENUM indent .TP \fB\-F, \-\-indent_forall=\fR FORALL indent .TP \fB\-j, \-\-indent_interface=\fR INTERFACE indent .TP \fB\-m, \-\-indent_module=\fR MODULE indent .TP \fB\-r, \-\-indent_procedure=\fR FUNCTION, SUBROUTINE and PROGRAM indent .TP \fB\-s, \-\-indent_select=\fR SELECT indent .TP \fB\-t, \-\-indent_type=\fR TYPE indent .TP \fB\-w, \-\-indent_where=\fR WHERE indent .TP \fB\-x, \-\-indent_critical=\fR CRITICAL indent .TP \fB\-\-indent_changeteam= \fR CHANGE TEAM indent .TP \fB\-C\-, \-\-indent_contains=restart, \fR restart indent after CONTAINS .TP \fB\-k, \-\-indent_continuation=\fR continuation indent except for lines starting with '&' free to free only .TP \fB\-k\-, \-\-indent_continuation=none\fR continuation lines not preceded by '&' are untouched free to free only .TP \fB \fR next defaults are: all \- all/2 .TP \fB\-c, \-\-indent_case=\fR CASE negative indent .TP \fB\-C, \-\-indent_contains=\fR CONTAINS negative indent .TP \fB\-e, \-\-indent_entry=\fR ENTRY negative indent .PP .SS Dependencies: .TP \fB\-\-deps\fR output dependency information only, other flags are ignored. This can be used to generate a dependencies file for usage with make(1). The format of this information: Fortran source \-> findent output include "file1" \-> inc file1 #include "file2" \-> cpp file2 #include \-> std file3 ??include 'file4' \-> coc file4 use module1 \-> use module1 submodule(m) subm \-> use m mod m:subm module module2 \-> mod module2 .TP \fB\-\-makefdeps\fR outputs a sh(1) script that serves as a an example to generate dependencies for use in make(1). .PP .SS "Environment: findent parses the environment variable FINDENT_FLAGS before the command\-line flags .PP .SS "Usage with vim: .TP \fB\-\-vim_help\fR outputs directions to use findent in (g)vim .TP \fB\-\-vim_fortran\fR outputs file 'fortran.vim', see \-\-vim_help .TP \fB\-\-vim_findent\fR outputs file 'findent.vim', see \-\-vim_help .PP .SS "Usage with gedit: .TP \fB\-\-gedit_help\fR outputs directions to use findent in gedit .TP \fB\-\-gedit_external\fR outputs script 'findent\-gedit', see \-\-gedit_help .TP \fB\-\-gedit_plugin\fR outputs file 'findent.plugin', see \-\-gedit_help .TP \fB\-\-gedit_plugin_py\fR outputs file 'python.py', see \-\-gedit_help .PP .SS "Usage with emacs: .TP \fB\-\-emacs_help\fR outputs directions to use findent in emacs .TP \fB\-\-emacs_findent\fR outputs script 'findent.el', see \-\-emacs_help .PP .SS Examples: indent: findent < in.f > out.f findent \-i2 \-r0 < in.f > out.f convert fixed to free form: findent \-ofree < prog.f > prog.f90 convert free to fixed form: findent \-ofixed < prog.f90 > prog.f refactor 'end': findent \-Rr < in.f90 > out.f90 .PP .SS BUGS: .TP \fB*\fR Also for free\-format, findent is space\-insensitive, while the standard states that space must be used as general separator. .TP \fB*\fR There are some issues with labels in a continuation when converting from free to fixed format. For example: 123& 4 continue The problems arise because it is not possible to define a statement label in a continuation in fixed format. .TP \fB*\fR When converting from fixed format to free format, findent discards white space in a string if the string contains a continuation, e.g: print *,"a +b" is converted to: print *,"a& &b" .SH DONATIONS .br Donations to support the maintenance of this program are welcome: https://paypal.me/wvermin .SH COPYRIGHT .br This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.