From 7cdefe9aa751fa54831cc1e64fbf4b16acc6c90e Mon Sep 17 00:00:00 2001 From: Johannes Hoff Date: Tue, 20 Jun 2017 20:18:15 -0700 Subject: Option to indent after first line This adds a command line argument `--indent_after_first` which sets the indentation of all lines after the first one, e.g. SELECT, UPDATE, etc. For example: $ sqlparse/__main__.py -r sample.sql UPDATE foo SET a = 1 WHERE a > 2 AND a < 10; $ sqlparse/__main__.py -r --indent_after_first sample.sql UPDATE foo SET a = 1 WHERE a > 2 AND a < 10; --- sqlparse/cli.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sqlparse/cli.py') diff --git a/sqlparse/cli.py b/sqlparse/cli.py index 0b5c204..0f66d90 100755 --- a/sqlparse/cli.py +++ b/sqlparse/cli.py @@ -101,6 +101,13 @@ def create_parser(): type=int, help='indentation width (defaults to 2 spaces)') + group.add_argument( + '--indent_after_first', + dest='indent_after_first', + action='store_true', + default=False, + help='indent after first line of statement (e.g. SELECT)') + group.add_argument( '-a', '--reindent_aligned', action='store_true', -- cgit v1.2.1