- 论坛徽章:
- 30
|
file(Name::filename(), Options::[term()]) -> ok
Tidies an Erlang source code file.
Available options are:
{backup_suffix, string()}
Specifies the file name suffix to be used when a backup file is created; the default value is ".bak" (cf. the backups option).
{backups, boolean()}
If the value is true, existing files will be renamed before new files are opened for writing. The new names are formed by appending the string given by the backup_suffix option to the original name. The default value is true.
{dir, filename()}
Specifies the name of the directory in which the output file is to be written. By default, the current directory is used. If the value is an empty string, the current directory is used.
{outfile, filename()}
Specifies the name of the file (without suffix) to which the resulting source code is to be written. If this option is not specified, the Name argument is used.
{printer, Function}
Function = (syntaxTree()) -> string()
Specifies a function for prettyprinting Erlang syntax trees. This is used for outputting the resulting module definition. The function is assumed to return formatted text for the given syntax tree, and should raise an exception if an error occurs. The default formatting function calls erl_prettypr:format/2.
{test, boolean()}
If the value is true, no files will be modified; this is typically most useful if the verbose flag is enabled, to generate reports about the program files without affecting them. The default value is false.
See the function module/2 for further options. |
|