mirror of
https://github.com/tstack/lnav
synced 2024-11-01 21:40:34 +00:00
[config] remove :save-config
This commit is contained in:
parent
ead1d3eb36
commit
82b34bb02a
2
NEWS
2
NEWS
@ -36,6 +36,8 @@ lnav v0.9.0:
|
||||
now respected for storing lnav's configuration. If you have an existing
|
||||
~/.lnav directory, that will continue to be used until you move it to
|
||||
$XDG_CONFIG_HOME/lnav or ~/.config/lnav.
|
||||
* Removed the ':save-config' command, changes to the configuration are now
|
||||
immediately saved.
|
||||
|
||||
Fixes:
|
||||
* Added 'notice' log level.
|
||||
|
@ -7,15 +7,15 @@ Configuration
|
||||
The configuration for **lnav** is stored in the following JSON files in
|
||||
:file:`~/.lnav`:
|
||||
|
||||
* :file:`config.json` - Contains local customizations that were done using the
|
||||
* :file:`config.json` -- Contains local customizations that were done using the
|
||||
:code:`:config` command.
|
||||
* :file:`configs/default/*.json` - The default configuration files that are
|
||||
* :file:`configs/default/*.json` -- The default configuration files that are
|
||||
built into lnav are written to this directory with :file:`.sample` appended.
|
||||
Removing the :file:`.sample` extension and editing the file will allow you to
|
||||
do basic customizations.
|
||||
* :file:`configs/installed/*.json` - Contains configuration files installed
|
||||
* :file:`configs/installed/*.json` -- Contains configuration files installed
|
||||
using the :code:`-i` flag (e.g. :code:`$ lnav -i /path/to/config.json`).
|
||||
* :file:`configs/*/*.json` - Other directories that contain :file:`*.json`
|
||||
* :file:`configs/*/*.json` -- Other directories that contain :file:`*.json`
|
||||
files will be loaded on startup.
|
||||
|
||||
Options
|
||||
|
@ -758,9 +758,6 @@ COMMANDS
|
||||
Reset a configuration option to the default value. Use
|
||||
'*' to reset all options.
|
||||
|
||||
save-config Save the current configuration state to:
|
||||
\~/.lnav/config.json
|
||||
|
||||
quit Quit lnav.
|
||||
|
||||
SQL QUERIES (experimental)
|
||||
|
@ -196,7 +196,7 @@
|
||||
|
||||
**See Also:**
|
||||
|
||||
:ref:`reset_config`, :ref:`save_config`
|
||||
:ref:`reset_config`
|
||||
|
||||
----
|
||||
|
||||
@ -1048,7 +1048,7 @@
|
||||
|
||||
**See Also:**
|
||||
|
||||
:ref:`config`, :ref:`save_config`
|
||||
:ref:`config`
|
||||
|
||||
----
|
||||
|
||||
@ -1064,20 +1064,6 @@
|
||||
----
|
||||
|
||||
|
||||
.. _save_config:
|
||||
|
||||
:save-config
|
||||
^^^^^^^^^^^^
|
||||
|
||||
Save the current configuration state
|
||||
|
||||
**See Also:**
|
||||
|
||||
:ref:`config`, :ref:`reset_config`
|
||||
|
||||
----
|
||||
|
||||
|
||||
.. _save_session:
|
||||
|
||||
:save-session
|
||||
|
@ -3401,6 +3401,7 @@ static Result<string, string> com_config(exec_context &ec, string cmdline, vecto
|
||||
} else if (!ec.ec_dry_run) {
|
||||
retval = "info: changed config option -- " + option;
|
||||
rollback_lnav_config = lnav_config;
|
||||
save_config();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3414,19 +3415,6 @@ static Result<string, string> com_config(exec_context &ec, string cmdline, vecto
|
||||
return Ok(retval);
|
||||
}
|
||||
|
||||
static Result<string, string> com_save_config(exec_context &ec, string cmdline, vector<string> &args)
|
||||
{
|
||||
string retval;
|
||||
|
||||
if (args.empty()) {
|
||||
}
|
||||
else if (!ec.ec_dry_run) {
|
||||
retval = save_config();
|
||||
}
|
||||
|
||||
return Ok(retval);
|
||||
}
|
||||
|
||||
static Result<string, string> com_reset_config(exec_context &ec, string cmdline, vector<string> &args)
|
||||
{
|
||||
string retval;
|
||||
@ -3452,6 +3440,7 @@ static Result<string, string> com_reset_config(exec_context &ec, string cmdline,
|
||||
if (!ec.ec_dry_run) {
|
||||
reset_config(option);
|
||||
rollback_lnav_config = lnav_config;
|
||||
save_config();
|
||||
}
|
||||
if (option == "*") {
|
||||
retval = "info: reset all options";
|
||||
@ -4687,14 +4676,6 @@ readline_context::command_t STD_COMMANDS[] = {
|
||||
})
|
||||
.with_tags({"configuration"})
|
||||
},
|
||||
{
|
||||
"save-config",
|
||||
com_save_config,
|
||||
|
||||
help_text(":save-config")
|
||||
.with_summary("Save the current configuration state")
|
||||
.with_tags({"configuration"})
|
||||
},
|
||||
{
|
||||
"reset-config",
|
||||
com_reset_config,
|
||||
|
@ -758,9 +758,6 @@ COMMANDS
|
||||
Reset a configuration option to the default value. Use
|
||||
'*' to reset all options.
|
||||
|
||||
save-config Save the current configuration state to:
|
||||
~/.lnav/config.json
|
||||
|
||||
quit Quit lnav.
|
||||
|
||||
SQL QUERIES (experimental)
|
||||
|
Loading…
Reference in New Issue
Block a user