Giter Site home page Giter Site logo

Comments (10)

drewblessing avatar drewblessing commented on August 23, 2024

@weisjohn How do you feel about this implementation?

I added a new configuration: "display_lists_in_pager" and defaulted it to true. If enabled, any command that lists bulk results (gitlab projects or gitlab snippets) will display results in the system pager or "less." All results are returned at all times whether this configuration is true or false. The understanding being that if you choose not to use the pager you could spew hundreds of results on the screen.

I really felt there was no good way to allow a user to set a 'results per page' value and page through them. Thoughts?

I will polish this implementation and await your thoughts. I haven't merged it into master or tagged it yet. Thanks.

from gitlab-cli.

weisjohn avatar weisjohn commented on August 23, 2024

@drewblessing that sounds awesome to me, I love the idea of sending it to less or whatever system pager is available. I don't know if you can determine if stdout is being redirected, but if you can, then I wouldn't send it to less in that case...

from gitlab-cli.

drewblessing avatar drewblessing commented on August 23, 2024

Hmm. I'm not sure if I can do that. Are you envisioning a case where someone might call this tool from another script or automated tool? In that case, it may require them setting that configuration to false.

With that in mind, it may also be a good idea to tie this configuration setting in with the other instances where I use the system pager - viewing snippets for example.

from gitlab-cli.

weisjohn avatar weisjohn commented on August 23, 2024

yeah, that's precisely the case that I'm using it for, but if setting display_lists_in_pager to false will cause the output to not go through less than that's fine.

from gitlab-cli.

drewblessing avatar drewblessing commented on August 23, 2024

yes, that will completely bypass less. In anticipation of also using this configuration with other purposes in the future, I've renamed it display_results_in_pager.

I tagged the changes as v1.1.0.pre. If you have an opportunity would you like to test these changes for me?

from gitlab-cli.

weisjohn avatar weisjohn commented on August 23, 2024

Looks great! I tried both options and it works perfectly! Thanks for doing this!

from gitlab-cli.

drewblessing avatar drewblessing commented on August 23, 2024

Glad to hear that. I am backtracking slightly on the default configuration here. To maintain original functionality I'm going to default this new configuration to false. I felt maintaining was important.

Also, I added some flags to allow you to override the paging on a one time basis. For example:
gitlab projects --nopager or gitlab projects --pager

from gitlab-cli.

drewblessing avatar drewblessing commented on August 23, 2024

Tagged and released in v1.1.0.

from gitlab-cli.

drewblessing avatar drewblessing commented on August 23, 2024

Thanks again @weisjohn. I appreciate your input.

from gitlab-cli.

weisjohn avatar weisjohn commented on August 23, 2024

You're welcome! Thanks for soliciting it / being open to it!

from gitlab-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.