diff options
author | Robin Jarry <robin@jarry.cc> | 2022-11-15 22:44:08 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-11-16 16:11:41 +0100 |
commit | 2e821009af339c9bf01d97a825a8d50273088730 (patch) | |
tree | 80f4500a0f51f01ce42212c3771192981c2111b6 | |
parent | 5dfc1ff5df71a62d9e114a84ac036cf4c2cb8540 (diff) | |
download | aerc-2e821009af339c9bf01d97a825a8d50273088730.tar.gz |
commands: remove broken :set command
This may have worked at some point in time but that is not the case
anymore. To accommodate for the rework of the config module, it needs to
be removed anyway.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
-rw-r--r-- | CHANGELOG.md | 4 | ||||
-rw-r--r-- | commands/set.go | 70 | ||||
-rw-r--r-- | doc/aerc.1.scd | 10 |
3 files changed, 4 insertions, 80 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 300acfcf..6c6a1d92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Overflowing text in header editors while composing can now be scrolled horizontally. +### Deprecated + +- Removed broken `:set` command. + ## [0.13.0](https://git.sr.ht/~rjarry/aerc/refs/0.13.0) - 2022-10-20 ### Added diff --git a/commands/set.go b/commands/set.go deleted file mode 100644 index 275f9e66..00000000 --- a/commands/set.go +++ /dev/null @@ -1,70 +0,0 @@ -package commands - -import ( - "errors" - "strings" - - "git.sr.ht/~rjarry/aerc/widgets" - - "github.com/go-ini/ini" -) - -type Set struct{} - -func setUsage() string { - return "set <category>.<option> <value>" -} - -func init() { - register(Set{}) -} - -func (Set) Aliases() []string { - return []string{"set"} -} - -func (Set) Complete(aerc *widgets.Aerc, args []string) []string { - return nil -} - -func SetCore(aerc *widgets.Aerc, args []string) error { - if len(args) != 3 { - return errors.New("Usage: " + setUsage()) - } - - config := aerc.Config() - - parameters := strings.Split(args[1], ".") - - if len(parameters) != 2 { - return errors.New("Usage: " + setUsage()) - } - - category := parameters[0] - option := parameters[1] - value := args[2] - - new_file := ini.Empty() - - section, err := new_file.NewSection(category) - if err != nil { - return nil - } - - if _, err := section.NewKey(option, value); err != nil { - return err - } - - if err := config.LoadConfig(new_file); err != nil { - return err - } - - // ensure any ui changes take effect - aerc.Invalidate() - - return nil -} - -func (Set) Execute(aerc *widgets.Aerc, args []string) error { - return SetCore(aerc, args) -} diff --git a/doc/aerc.1.scd b/doc/aerc.1.scd index 9fe1dd59..4f9b6a7f 100644 --- a/doc/aerc.1.scd +++ b/doc/aerc.1.scd @@ -92,16 +92,6 @@ These commands work in any context. *pwd* Displays aerc's current working directory in the status bar. -*set* <category>.<option> <value> - Changes the value of a configuration parameter at runtime. The category is - the name of the [heading] for the config option you wish to change, and the - option is the name of the config option. For example, to change this option: - - \[ui]++ - index-format=before - - Use :set ui.index-format after. - *term* [command...] *terminal* Opens a new terminal tab with a shell running in the current working |