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

add CLI option to only show actions taken #258

Open
eengstrom opened this issue Feb 8, 2021 · 4 comments
Open

add CLI option to only show actions taken #258

eengstrom opened this issue Feb 8, 2021 · 4 comments

Comments

@eengstrom
Copy link
Contributor

The current CLI supports both:

  • -q - quiet
  • -Q - really-quiet

What I would find really useful is an option to print only actions taken. If no action taken (e.g. link already exists), then output nothing. I'm open to any alternative for the name of the option(s), but I'd suggest something like

-a, --actionable     show only output when actions are taken

e.g.

$ dotbot --actionable
Creating link ~/bin -> .conf/bin
Removing ~/.bashrc
Creating link ~/.bashrc -> .dot/bashrc

That way, you get the best of -Q and yet only show results when anything actually changed. This avoids the, IMO, extraneous lines such as

Link exists ~/.conf -> Projects/conf

and the boilerplate:

All links have been set up
All targets have been cleaned

==> All tasks executed successfully

I'm not at all sure how this would work with various plug-ins, and obviously there would be some overlap in work related to the idea of a --dryrun option (#236)

@eengstrom
Copy link
Contributor Author

... I should add that I'm happy to provide a PR if this seems useful to others. Input welcome on the option names as well as tips for how to make this happen in a style you'd like.

@anishathalye
Copy link
Owner

I like this idea. What do you think about just making this the default behavior? Or even if not the default, just changing the behavior of -q / --quiet to do what you proposed?

I think changing exactly is printed to the console shouldn't break anyone's workflows -- hopefully they are not depending on the contents of stdout when running dotbot.

I think we already have too many options for verbosity level, there's -v, none, -q, and -Q, so I'd prefer not to add another one.

@eengstrom
Copy link
Contributor Author

Personally, I'd be in favor of my suggested behavior being the default, and then -v | --verbose gets you what is currently the default. -Q would become obsolete and subsumed by -q | --quiet.

Even though I see how others might find that a dramatic change, I would be surprised if many are / anyone is relying upon the output of dotbot in some pipeline for non-human consumption.

So, if you, @anishathalye, are willing to make that change in default behavior, I'm fine with it as well. Just to be clear, EVERY plug-in has to abide by this definition as well.

As I mentioned in other issue, you have a reason or desire to work on this yourself, or do you prefer a PR?

@anishathalye
Copy link
Owner

I can work on this one myself. Might ask you to take a look once I have a patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants