![]() |
![]()
| ![]() |
![]()
NAMEpgFormatter::CLI - Implementation of command line program to format SQL queries. VERSIONVersion 5.6 SYNOPSISThis module is called by pg_format program, when it detects it is not being run in CGI environment. In such case all control over flow is passed to this module by calling: my $program = pgFormatter::CLI->new(); $program->run() FUNCTIONSnewObject constructor, nothing fancy in here. runWraps all work related to pg_format CLI program. This includes calling methods to read command line parameters, validate them, read query, beautify it, and output. beautifyActually formats loaded query using pgFormatter::Beautify library. If necessary runs anonymization. save_outputSaves beautified query to whatever is output filehandle logmsgDisplay message following the log level show_help_and_dieAs name suggests - shows help page, with optional error message, and ends program. load_sqlLoads SQL from input file or stdin. get_command_line_argsParses command line options into $self->{'cfg'}. validate_argsValidates that options parsed from command line have sensible values, opens input and output files. AUTHORpgFormatter is an original work from Gilles Darold BUGSPlease report any bugs or feature requests to: https://github.com/darold/pgFormatter/issues COPYRIGHTCopyright 2012-2025 Gilles Darold. All rights reserved. LICENSEpgFormatter is free software distributed under the PostgreSQL Licence. A modified version of the SQL::Beautify Perl Module is embedded in pgFormatter with copyright (C) 2009 by Jonas Kramer and is published under the terms of the Artistic License 2.0.
|