walles / moar

Moar is a pager. It's designed to just do the right thing without any configuration.
Other
675 stars 19 forks source link

optional support n headlines, that alway visible at top of screen #212

Open jaegdi opened 5 months ago

jaegdi commented 5 months ago

Hi, at first: great job and i like moar. i'm unhappy, that my go skill is not so good, that i can implement that by myself an send a pull request.

I often have long output that has on the fist n lines a header. It would be nice, if moar can support this by an optional parameter like eg. -headlines=3. Then the fist 3 lines are always on the top of the screen and the other lines a scrolling (like in excel with fixed rows)

best regards

walles commented 5 months ago

Just out of curiosity, what kind of output is this?

jaegdi commented 4 months ago

For example, when i ask the openshift/kubernetes cluster for list all pods with node eg.: oc get pod -o wide then the output has several columns and the first line is a headerline. when i use less as pager and i scroll down, then the headerline disapear and it would be much nicer, to have an pager, who let the headline fix in the top line of the screen and scroll/page all the data lines below.

jaegdi commented 4 months ago

for example this output

NAMESPACE                                          NAME                                                              READY   STATUS             RESTARTS         AGE     IP              NODE                        NOMINATED NODE   READINESS GATES
aps-build                                          aps-ad1e901d2651afebab68f1bc00e160d1eca45b55db8929bfd345c90-pod   0/1     Completed          0                2d8h    10.129.15.168   cid-scp0-inf-v08.sf-rz.de   <none>           <none>
aps-build                                          aps-ad2f6546c68f2267cbd4cdaaf33174284eaccbe0fcfe922a59344f6-pod   0/1     Completed          0                6d10h   10.129.14.114   cid-scp0-inf-v08.sf-rz.de   <none>           <none>
aps-build                                          aps-ad4e6b41e5972414f26627ae8b66822a30c08a7d24bff7ea730efde-pod   0/1     Completed          0                6d14h   10.129.15.162   cid-scp0-inf-v08.sf-rz.de   <none>           <none>
aps-build                                          aps-ad66bbda4f9b558064418a5f9113d072d9d4b574355b43b5fe6d04c-pod   0/1     Completed          0                5d14h   10.129.15.78    cid-scp0-inf-v08.sf-rz.de   <none>           <none>
...

but with hundrets of lines and i like to see always the first line with the headings when i scroll down.

This kind of output is typical for the output of system commands and in a cluster environment the output often has several hundret lines and many "columns" with very similar data, so it is difficult to interpret the data without a visible headline.

walles commented 4 months ago

Do you have any examples with more than one header line?

jaegdi commented 4 months ago

Sorry for the delay. I was in vacation. here an example, where the first 3 lines should be fixed at top: headline-example.txt