dust icon indicating copy to clipboard operation
dust copied to clipboard

Is it possible to configure this globally?

Open IceSentry opened this issue 4 years ago • 7 comments

I want to be have the reverse option on by default and I'd rather not have to remember to type -r every time.

IceSentry avatar Aug 05 '21 17:08 IceSentry

how would that work? Are you thinking of an environment variable ?

bootandy avatar Aug 06 '21 08:08 bootandy

Could be an env var, but a lot of cli tools have a config file that it then looks for at a few location.

A few examples: https://github.com/Peltoche/lsd#configuration https://starship.rs/config/ https://github.com/dalance/procs#configuration https://github.com/XAMPPRocky/tokei#configuration https://clementtsang.github.io/bottom/nightly/configuration/config-file/default-config/

IceSentry avatar Aug 06 '21 16:08 IceSentry

thanks, I'll look into this.

bootandy avatar Aug 11 '21 14:08 bootandy

alias dust="dust -r" and you could then use \dust to not use it, for posix shell only

xenoterracide avatar Oct 21 '21 14:10 xenoterracide

I'm on windows, alias are a fine workaround if you can use them easily, but having a global configuration can be much easier to read than a shell command with a bunch of flags and no comments.

IceSentry avatar Oct 21 '21 15:10 IceSentry

I mean with Shell you can have global configurations... Unless you're trying to switch between batch, power shell and a posix shell. And obviously shell scripts, at least posix shell scripts, can have comments, also in shell scripts long options are generally preferred for readability and maintenance.

That said I'm not against a config file but for this particular scenario it doesn't seem like It's necessary in my mind. I noticed this when I opened an issue asking for an ignore config file, since an ignore file could be account global or directory local.

xenoterracide avatar Oct 21 '21 23:10 xenoterracide

I would love to see this happen as well Please make it in $XDG_CONFIG_HOME by default 😊

https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

IzhakJakov avatar Mar 14 '22 14:03 IzhakJakov

Can I get some feedback on if this is a sensible way to add config file support?

https://github.com/bootandy/dust/pull/243

thanks,

bootandy avatar Aug 19 '22 12:08 bootandy

Added code to do this, will go out in the next release.

bootandy avatar Aug 23 '22 08:08 bootandy