Config file and/or environment variables #17

Open
opened 2022-10-18 13:22:55 +01:00 by forquare · 1 comment
forquare commented 2022-10-18 13:22:55 +01:00 (Migrated from github.com)

I didn't want to add a config file...But sometimes certain default behaviours are annoying, but maybe still should be default.

For instance:

%>zht search -r 'git clone.*myrepo.git'
: 1664899764:2;git clone git@github.com:myuser/myrepo.git

When I am searching I don't usually want to know the time, and if I do maybe I want the time to be human readable?
Later maybe I want to define my own format...?

I think the default functionality is fine by default, but my cases are changing. So a mechanism needs to be implemented to apply certain behaviours by default - either a config file, or a suite of Environment Variables (or both!) that are checked and alter behaviour.

Possibly everything should be configurable externally, but thoughts:

  • Output command only in searches (#19)
  • Define default output format (#18)
  • Set human readable timestamps by default
I didn't want to add a config file...But sometimes certain default behaviours are annoying, but maybe still _should_ be default. For instance: ``` %>zht search -r 'git clone.*myrepo.git' : 1664899764:2;git clone git@github.com:myuser/myrepo.git ``` When I am searching I don't _usually_ want to know the time, and if I do maybe I want the time to be human readable? Later maybe I want to define my own format...? I think the default functionality is fine _by default_, but _my_ cases are changing. So a mechanism needs to be implemented to apply certain behaviours by default - either a config file, or a suite of Environment Variables (or both!) that are checked and alter behaviour. Possibly everything should be configurable externally, but thoughts: * Output command only in searches (#19) * Define default output format (#18) * Set human readable timestamps by default
forquare commented 2022-10-18 13:47:16 +01:00 (Migrated from github.com)
Consider: https://github.com/spf13/viper
This discussion has been locked. Commenting is limited to contributors.
No description provided.