guumaster / hostctl

Your dev tool to manage /etc/hosts like a pro!

Home Page:http://guumaster.github.io/hostctl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Minimal Output

smhmd opened this issue · comments

Is your feature request related to a problem? Please describe.
I use /etc/hosts to block websites during work and it exceeds 20,000 lines. When listing profiles, it all gets outputted.

Describe the solution you'd like
I would love there to be a minified output flag (through persistent configuration? hostctl config minimal)

Describe alternatives you've considered
outputting to /dev/null, but I want to see enabled/disabled profiles.

We can add a -q to silence output.

Also I'm thinking about a config file so users can tweat default behavior

Great. I also think a command for on/off profiles could be useful.

$ hostctl list -m
awesome on
meh off
splendid on

This is much easily scripted as I want to make a dmenu script for turning profiles on and off.

effectively, hostctl list --raw -c profile,status | uniq.

just an idea, not really a feature request:
How about hostctl toggle along side enable and disable?

hostctl list -m

What would be the meaning of -m? menu? not sure I get it.

The toggle idea could be useful. Or even some kind of "only" to turn all off and switch to one specific profile.

the -m is for minimal.

Or even some kind of "only" to turn all off and switch to one specific profile.

I agree. Different modes for enabling/disabling can be very handy.

I suggested toggle just to ease with the cognitive load and make use of commands from history.

Another mere suggestion and not a feature request is having hostctl list --on/hostctl list --off to list only on or off profiles.

This issue ended up on this features:

  • hostctl list enabled to show only enabled profiles. (also works with alias on)
  • hostctl list disabled to show only disabled profiles. (also works with alias off)
  • hostctl status to show only one profile name per line and its status

Thanks for your contribution @smhmd!