mirror of https://github.com/dbcli/pgcli
Set multi-line via config file.
This commit is contained in:
parent
e9868b7d98
commit
96b6441bd8
2
TODO
2
TODO
|
@ -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.
|
||||
|
|
|
@ -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])
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
[main]
|
||||
smart_completion = true
|
||||
multi_line = False
|
Loading…
Reference in New Issue