Allow underline on last line in table output
Expected Behavior
Request to add footer
Current Behavior
The current Header option gave a nice output made the output look pretty, I was wondering if there could be an option of adding this would add a nice break view for where the prompts are colorized. adding a footer makes the view more pleasing and a box like view would be nice.
I am looking at the code. but in the meantime, any light on feature request or is it in the pipeline.
Hello @rakeshgm, thanks for submitting this feature request.
First off: no, this is not in the pipeline.
Secondly: I'd be quite reluctant to add more output to the kubectl output.
If I understand you correctly, then what you're suggesting is something like this?
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
nginx-7c5ddbdf54-9d575 0/1 ContainerCreating 0 15m
nginx-7c5ddbdf54-f6wft 1/1 Running 0 15m
nginx-7c5ddbdf54-h6dnn 1/1 Terminating 0 15m
nginx-7c5ddbdf54-vtsqw 0/1 CrashLoopBackOff 0 15m
NAME READY STATUS RESTARTS AGE
If that's the case, then I'd preliminary say no. Changing the output in this way is a big no no. It would be too intrusive. One core idea with kubecolor is that if you trim away the coloring, then the output should be exactly the same as kubectl.
Or do you mean adding a footer a different way? Could you provide an example?
Thanks for the quick reply. I must have explained a bit better. this is what i wanted to see.
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
-----------------------------------------------------------------------
nginx-7c5ddbdf54-9d575 0/1 ContainerCreating 0 15m
nginx-7c5ddbdf54-f6wft 1/1 Running 0 15m
nginx-7c5ddbdf54-h6dnn 1/1 Terminating 0 15m
nginx-7c5ddbdf54-vtsqw 0/1 CrashLoopBackOff 0 15m
-----------------------------------------------------------------------
I believe the underline for the header is already there. so just to add underline below the output. I have edited the issue title.
Ah alright. Just to be clear, are we talking about the color code for underline (such as underlined text), or adding a row of dash symbols (such as --------------)?
Kubecolor doesn't add either by default, but at least the underline color code is possible via theme configuration. The tables shown in kubectl describe do have --------- lines under the header, but that's just how kubectl behaves.
Are you suggesting adding a theme config to allow adding underline on the last row in a table? Such as:
export KUBECOLOR_THEME_TABLE_FOOTER="underline"
yes, exactly like this export KUBECOLOR_THEME_TABLE_FOOTER="underline" to result in underline on the last row
Ok nice, then we're on the same page. This sounds like a nice addition, however I suspect the implementation might not be super straight forward, due to:
- We don't always know when we have the last line in a table (e.g in
kubectl get pods --watch), so some exceptions need to be in place. - The last line already has some colors applied. So we need to be careful when injecting colors and make sure we have good tests on this.
Not impossible, just slightly difficult.
Also, for whoever takes on this task, a config name like "last" would probably be better than "footer" as the output doesn't actually have a footer line. Such as:
-
KUBECOLOR_THEME_TABLE_LAST, -
KUBECOLOR_THEME_TABLE_LASTLINE, or -
KUBECOLOR_THEME_TABLE_LASTROW
Btw I will not be developing anything for a while as I'm on vacation. If you want to tackle this, then feel free to :) I will still help during the review process, as that's easier to do from my phone.
Otherwise, I'd like to give a heads-up that it may take a while until this gets implemented.
@rakeshgm thanks for your request.
Kubecolor is not meant to change the output of kubectl, just enhance it with colors.
Let's keep this issue opened in a backlog, but a better option for you would be to open the issue directly to kubectl project. That said, I also doubt they will implement it quickly.
@prune998 as far as I understood, this feature request is not about changing the output, but instead allowing the user to apply the "underline" styling to the last row so it creates the sense of a border at the bottom. Something like this:
This is something that could be something we add. Mixing in colors in ANSI color codes isn't super easy, but should definitely be possible.