feat: add configuration support to enbas #32

Manually merged
dananglin merged 1 commit from json-configuration into main 2024-06-25 12:46:11 +01:00
Owner

Summary

This commit adds configuration support to enbas.

The configuration is stored as a JSON file in the user specified configuration directory.

When using enbas for the first time, the user will first need to execute the new init command in order to generate the configuration. Once this has been generated the user can edit the settings to personalise their experience, then login and use enbas as normal.

For now the configurable settings included in the configuration file are as follows:

  • The path to the credentials file (by default this is set to a file in the same directory as the configuration file)
  • The path to the cache directory
  • The character limit used for line wrapping
  • The programs used for integrations such as paging, media viewing, opening URLs, etc

Changes

  • added the new config type
  • added the new init executor for generating a new configuration file
  • removed the following top level flags in favour of the new configration support
    • cache-dir
    • pager
    • image-viewer
    • video-player
    • max-terminal-width
  • added a new error type for use when an unknown media attachment ID is specified
  • updated the usage function for the executors to support a case where a flagsets has no flags
  • update .golangci.yaml to disable some linters
### Summary This commit adds configuration support to enbas. The configuration is stored as a JSON file in the user specified configuration directory. When using enbas for the first time, the user will first need to execute the new `init` command in order to generate the configuration. Once this has been generated the user can edit the settings to personalise their experience, then login and use enbas as normal. For now the configurable settings included in the configuration file are as follows: - The path to the credentials file (by default this is set to a file in the same directory as the configuration file) - The path to the cache directory - The character limit used for line wrapping - The programs used for integrations such as paging, media viewing, opening URLs, etc ### Changes - added the new config type - added the new init executor for generating a new configuration file - removed the following top level flags in favour of the new configration support - cache-dir - pager - image-viewer - video-player - max-terminal-width - added a new error type for use when an unknown media attachment ID is specified - updated the usage function for the executors to support a case where a flagsets has no flags - update .golangci.yaml to disable some linters
dananglin added 5 commits 2024-06-25 12:19:39 +01:00
- disable some linters
- all executors now uses the config value
- some variable renaming based on golangci-lint feedback
- add path to the credentials file to the config so users can define the
  path to the credentials file
dananglin added 1 commit 2024-06-25 12:33:32 +01:00
dananglin added this to the v0.1.0 milestone 2024-06-25 12:39:23 +01:00
dananglin force-pushed json-configuration from 6698fb0d31 to 42251f6df8 2024-06-25 12:45:20 +01:00 Compare
dananglin manually merged commit 42251f6df8 into main 2024-06-25 12:46:11 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: apollo/enbas#32
No description provided.