rat icon indicating copy to clipboard operation
rat copied to clipboard

What should the default command be?

Open akkartik opened this issue 7 years ago • 4 comments

Right now it's cat ~/.config/rat/ratrc.

However, the location of ratrc is no longer hard-coded. At the very least we should make the command consistent with that.

But perhaps there's a better default? Perhaps it's better to have no default, just a usage message?

akkartik avatar Oct 11 '17 17:10 akkartik

Maybe user could specify default command per mode? Edit: I imagine it could work like this: Every mode might have defined default command. Rat could use first param as mode switch by default. So instead writing rat --mode files --cmd "ls -al" you could write rat ls, rat git and so on. You could override default command with --cmd flag rat files --comand "ls -thor"

TeddyDD avatar Oct 11 '17 19:10 TeddyDD

instead writing rat --mode files --cmd "ls -al" you could write rat ls, rat git and so on.

I actually see this verbosity problem being solved by aliases and other wrapper scripts. I have a couple I use personally: search and git-rat.

I think cmd could just be a required arg for now.

ericfreese avatar Oct 13 '17 00:10 ericfreese

It's not about verbosity but about easy configuration sharing. Currently you have git example - and I don't know how to use it since I don't know default command. I have no problem with wrapper scripts but I think default command per mode will be common pattern.

TeddyDD avatar Oct 18 '17 11:10 TeddyDD

Currently you have git example - and I don't know how to use it since I don't know default command

The idea with git-rat is that there is no default command. You can call it with any git command and it will run that command with mode git.misc which tries to annotate all kinds of git things.

I think default command per mode will be common pattern.

I'm not personally convinced of this but if you make a PR for it I'll likely merge as Rat is still at a prototype/experimental stage where I think we should try out things to see if they stick.

ericfreese avatar Oct 18 '17 14:10 ericfreese