bootleg icon indicating copy to clipboard operation
bootleg copied to clipboard

Formatting of hosts could be prettier

Open justindotpub opened this issue 7 years ago • 4 comments

Is there a reason why there's an extra space after the IP address in all bootleg output?

[a.b.c.d ]

justindotpub avatar Aug 31 '17 17:08 justindotpub

The host name is padded with 10 spaces to the right. In your case it's an IP address but this could also be an alias from /etc/hosts or a fully-qualified domain name.

The original reason for this was an attempt to get host names to line up when having multiple servers, e.g.:

[host1  ] doing it
[host256] doing it

rjanja avatar Aug 31 '17 18:08 rjanja

Okay, so this just gets them to line up right if they aren't too long (i.e. no 15 character IP addresses or longer than 10 char hostnames). It just looks off, but it obviously doesn't need to be considered a bug. :)

justindotpub avatar Aug 31 '17 18:08 justindotpub

Discussed this with @holetse earlier and we decided to keep this around as a future fix-it ticket. One possible solution he brought up: Bootleg could calculate maximum length of hostnames / IPs and decide on a padding format at start-up.

rjanja avatar Sep 01 '17 23:09 rjanja

How are we feeling about just padding like so:

[host]    do it
[host123] do it

brienw avatar Oct 02 '17 20:10 brienw