Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow partial configuration file where some configuration keys may be missing #105

Closed
gokuldas opened this issue Aug 12, 2023 · 0 comments · Fixed by #116
Closed

Allow partial configuration file where some configuration keys may be missing #105

gokuldas opened this issue Aug 12, 2023 · 0 comments · Fixed by #116
Assignees
Labels
feature New feature or request good first issue Good for newcomers

Comments

@gokuldas
Copy link

Is your feature request related to a problem? Please describe.

If we create a partial configuration file where only some configuration options are defined, gpg-tui errors out on launch with a message similar to this:

Error: TOML parse error at line 1, column 1
  |
1 | [general]
  | ^^^^^^^^^
missing field `splash`

Gpg-tui currently doesn't accept a configuration file unless all configuration keys are defined.

Describe the solution you'd like

Here are some of the problems that arise from requiring the user to define all configuration keys:

  • A user might wish to retain the default configuration for most of configuration keys, and override just a few of them. It's a hassle to find out the appropriate values for every key.
    • The values identified by the user for a key may be wrong - even though they may not want to override it. This happened to me. I took default values from the man pages. However, gpg-tui was blank when it was launched. I'm still unable to figure out which key caused that.
  • If an update of gpg-tui adds a configuration key, the user will be forced to add it to the config file manually. The application won't launch without it.

The appropriate solution would be to assume default values for all keys and then allow the user to selectively override them in the config file.

Describe alternatives you've considered

One possibility is to define all the default values in a system-wide config file (somewhere in /etc or /usr/share). Read this file first. Then read the user config file (from ~/.config) and overwrite values for those variables that are defined in it.

Additional context

None

@orhun orhun added feature New feature or request good first issue Good for newcomers labels Aug 20, 2023
PThorpe92 added a commit to PThorpe92/gpg-tui that referenced this issue Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants