diff options
author | Iryna Cherniavska <i.chernyavska@gmail.com> | 2014-12-29 14:15:23 -0800 |
---|---|---|
committer | Iryna Cherniavska <i.chernyavska@gmail.com> | 2014-12-29 14:15:23 -0800 |
commit | 96b6441bd892e516aed85be6511a731b5299998e (patch) | |
tree | 860c0f157b920051ba6ac1ae3da6b8a7fa9f3c1f | |
parent | e9868b7d98de19672b0737bb69287b1f450a5417 (diff) |
Set multi-line via config file.
-rw-r--r-- | TODO | 2 | ||||
-rwxr-xr-x | pgcli/main.py | 3 | ||||
-rw-r--r-- | pgcli/pgclirc | 1 |
3 files changed, 4 insertions, 2 deletions
@@ -14,7 +14,7 @@ * [ ] Find a way to add documentation to sql commands. This could get tricky. * [ ] Refactor the execution and output into a separate class. * [ ] Create a class for the config and make it easy to access. -* [ ] Set multi-line via config file. +* [X] Set multi-line via config file. * [ ] New Feature List - Write the current version to config file. At launch if the version has changed, display the changelog between the two versions. * [X] Separate the column completions to be table specific. (SELECT, INSERT, UPDATE) * [X] Fix: Autocompletion won't go away after semi-colons. This an artifact of stripping special chars in the partially typed words. Need to selectively remove parens. diff --git a/pgcli/main.py b/pgcli/main.py index 5dab1403..eed43e38 100755 --- a/pgcli/main.py +++ b/pgcli/main.py @@ -52,6 +52,7 @@ def cli(database, user, password, host, port): # Load config. config = load_config('~/.pgclirc') smart_completion = config.getboolean('main', 'smart_completion') + multi_line = config.getboolean('main', 'multi_line') less_opts = os.environ.get('LESS', '') if not less_opts: @@ -81,7 +82,7 @@ def cli(database, user, password, host, port): for table in tables: completer.extend_column_names(table, pgexecute.columns(table)) completer.extend_database_names(pgexecute.databases()) - line = PGLine(always_multiline=False, completer=completer, + line = PGLine(always_multiline=multi_line, completer=completer, history=FileHistory(os.path.expanduser('~/.pgcli-history'))) cli = CommandLineInterface(style=PGStyle, layout=layout, line=line, key_binding_factories=[emacs_bindings, pgcli_bindings]) diff --git a/pgcli/pgclirc b/pgcli/pgclirc index e487f2fb..27b389c1 100644 --- a/pgcli/pgclirc +++ b/pgcli/pgclirc @@ -1,2 +1,3 @@ [main] smart_completion = true +multi_line = False
\ No newline at end of file |