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

Override config file #107

Open
bergercookie opened this issue Mar 3, 2020 · 7 comments
Open

Override config file #107

bergercookie opened this issue Mar 3, 2020 · 7 comments

Comments

@bergercookie
Copy link

bergercookie commented Mar 3, 2020

Hi, thanks for this tool!

It would be really useful to add a flag for the user to specify a custom configuration file, something like --override-config <...>

In my case, I want to call tldr from albert and in that case (only in that case, not system-wide) I 'd like to specify a custom configuration file which overrides the use_pager option

@dbrgn
Copy link
Owner

dbrgn commented Mar 3, 2020

Hi! Could you maybe override XDG_CONFIG_HOME?

$ XDG_CONFIG_HOME=/tmp tldr --config-path
Config path is: /tmp/tealdeer/config.toml

@bergercookie
Copy link
Author

That could be a way I suppose, but it's more of a hack rather than a solution to this.

This isn't super important to me, I can bypass it and parse the markdown files directly. I raised the issue because I thought it was a nice feature to have.

FWIW, here's the albert plugin I'm using tldr for: https://github.com/bergercookie/awesome-albert-plugins/tree/master/plugins/tldr_pages

@dbrgn
Copy link
Owner

dbrgn commented Mar 3, 2020

Yeah, I suppose a --config flag wouldn't hurt 🙂

@niklasmohrin
Copy link
Collaborator

This could also be considered when running with the --seed-config flag to specify where to put the generated file. I think the option should then have a more verbose name like config-location (unfortunately config-path is already taken).

@dmaahs2017
Copy link
Contributor

(unfortunately config-path is already taken)

Should --config-path be deprecated considering we have --show-paths? Or perhaps --config-path should be renamed to --show-config-path.

Or for consistency, deprecate --config-path in preference for something like this --show-path <config|cache|pages|custom>. Then we would have show-paths and show-path <enum> which would be a bit more intuitive.

Isn't so relevant to this issue, but is this worth raising a new issue for @dbrgn @niklasmohrin ?

@dbrgn
Copy link
Owner

dbrgn commented Jan 29, 2022

--config-path is already deprecated:

danilo@c3po:~$ tldr --config-path
Warning: The --config-path flag is deprecated, use --show-paths instead
Config path is: /home/danilo/.config/tealdeer/config.toml

It will be removed in a future version.

@niklasmohrin
Copy link
Collaborator

About --show-path <config|cache|pages|custom>: I feel like --show-paths is primarily intended for humans to understand how path precedence works with tealdeer or to initially find a place of interest. Having the single --show-path to me seems like a convenience thing for scripts, but they can just know the location or grep it from --show-paths. Unless specific feature requests come in, I would not bother to implement it

@niklasmohrin niklasmohrin added this to the v1.7.0 milestone Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants