~yziquel


#209 Specify himalaya configuration through HIMALAYA_ environment variables. a month ago

~soywod assigned ~yziquel to #209 on ~soywod/pimalaya

#209 Specify himalaya configuration through HIMALAYA_ environment variables. 2 months ago

Comment by ~yziquel on ~soywod/pimalaya

I got this working here:

https://github.com/gl-yziquel/himalaya/tree/yziquel

Feel free to comment.

#209 Specify himalaya configuration through HIMALAYA_ environment variables. 2 months ago

Comment by ~yziquel on ~soywod/pimalaya

It seems to be gated behind the "env" feature of clap:

https://docs.rs/clap/latest/clap/_features/index.html

The "env" feature of clap is not enabled, it seems, in himalaya's Cargo.toml.

#209 Specify himalaya configuration through HIMALAYA_ environment variables. 2 months ago

Comment by ~yziquel on ~soywod/pimalaya

It seems that this functionality is already in clap:

https://github.com/clap-rs/clap/commit/797b6b3340dd254b3387f453172a396f4c943182

#209 Specify himalaya configuration through HIMALAYA_ environment variables. 2 months ago

Ticket created by ~yziquel on ~soywod/pimalaya

While there are workarounds that I may implement, it would be really nice if himalaya did support a way to get its configuration file from an environment variable that is not $HOME or $XDG_*. Both these environment variables are coupled to tons of other software, and it would be nice if, when entering a folder, direnv allowed to set the environment variable that specifies the himalaya config path. As this could be construed as unsafe in some context, one may eventually gate that extra behaviour behind a command line flag.

As of today, having had a look at the code, one gets the path only via the CLI or via these broad environment environment variables (HOME, and XDG_*). It's "cli", or "default" in from_paths_or_default. If clap allows easy integration with environment variables, one could put a HIMALAY_ env var in the cli part of the code. If not, the from_paths_or_default is not a really a good name as it's not "default" but "custom".

I'd like to hack it, if only for my own needs. However, if that needs to be pushed upstream, it would be nice to know where some HIMALAYA_ environment variables would fit in between "cli" and "default".

#208 himalaya --help should list command to display configuration information 2 months ago

Comment by ~yziquel on ~soywod/pimalaya

[comment removed. Duplicate.]

#208 himalaya --help should list command to display configuration information 2 months ago

Ticket created by ~yziquel on ~soywod/pimalaya

I checked on git HEAD. The himalaya --help command does not seem to provide and kind of "info" command that would inform the user of the configuration setup of himalaya, notably the location of the configuration file of himalaya. That would be really cool, for the end user.