From 19ed8b28aa673949f2498aeec2debfebe41f8874 Mon Sep 17 00:00:00 2001 From: laixintao Date: Thu, 15 Oct 2020 19:06:35 +0800 Subject: doc: add history_file per dsn config, and --history option. --- pgcli/main.py | 4 ++++ pgcli/pgclirc | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/pgcli/main.py b/pgcli/main.py index b1468985..e949d24d 100644 --- a/pgcli/main.py +++ b/pgcli/main.py @@ -1194,6 +1194,9 @@ class PGCli(object): @click.option( "--warn/--no-warn", default=None, help="Warn before running a destructive query." ) +@click.option( + "--history", default=None, help="Specify history file location." +) @click.argument("dbname", default=lambda: None, envvar="PGDATABASE", nargs=1) @click.argument("username", default=lambda: None, envvar="PGUSER", nargs=1) def cli( @@ -1217,6 +1220,7 @@ def cli( auto_vertical_output, list_dsn, warn, + history, ): if version: print("Version:", __version__) diff --git a/pgcli/pgclirc b/pgcli/pgclirc index e97afdab..60b79a20 100644 --- a/pgcli/pgclirc +++ b/pgcli/pgclirc @@ -58,7 +58,8 @@ generate_casing_file = False # Casing of column headers based on the casing_file described above case_column_headers = True -# history_file location. +# default history_file location. You can also set history file location for +# specific database. see [dsn_history_file] section. # In Unix/Linux: ~/.config/pgcli/history # In Windows: %USERPROFILE%\AppData\Local\dbcli\pgcli\history # %USERPROFILE% is typically C:\Users\{username} @@ -187,6 +188,11 @@ output.null = "#808080" [alias_dsn] # example_dsn = postgresql://[user[:password]@][netloc][:port][/dbname] +# Specify sperate history file for alias_dsn. +# If not set, will use history_file settings. +[dsn_history_file] +# example_dsn = ~/.config/pgcli/example_dsn.history + # Format for number representation # for decimal "d" - 12345678, ",d" - 12,345,678 # for float "g" - 123456.78, ",g" - 123,456.78 -- cgit v1.2.3