GithubHelp home page GithubHelp logo

Add a option to help with --and-exit about dragon HOT 2 OPEN

mwh avatar mwh commented on August 17, 2024
Add a option to help with --and-exit

from dragon.

Comments (2)

mwh avatar mwh commented on August 17, 2024

This seems pretty reasonable. The goal is essentially that each entry can be dragged out once ("shelf"-style), and the program exits when there are no entries remaining?

I wonder whether this is severable into two parts:

  1. Once-each mode, where an item is removed from the list once dragged out. Perhaps this is -1, --once-each.
  2. Exit on empty, where the program closes once there are no entries left. Perhaps this is -X, --exit-empty. Arguably we could overload the existing -x with this meaning, but I imagine someone may have made a menu system or something out of it for which this would be a breaking change.

The mode you want would then be dragon -1 -X file.... A "shelf" mode, where it starts up and you can drag items in for temporary storage and back out at will, would be dragon -t -k -1 or something.

The shelf may be the only use for -1 without -X, however, so perhaps this is really two separate modes with some shared functionality: drag-and-remove until exhausted (your proposal), and drag-in-and-out-once (shelf). If there are other use cases for -1 or -X in the future it would be nice to have them, but I'm unsure whether there are other use cases or functionality where they make sense.

I know there are some others who watch these issues, so they might have comments on that. If you've already implemented this, however, I guess my question is: how straightforward is it to separate those two aspects? The functionality you describe sounds valuable already.

from dragon.

DevHyperCoder avatar DevHyperCoder commented on August 17, 2024

The goal is essentially that each entry can be dragged out once ("shelf"-style), and the program exits when there are no entries remaining?

Exactly that!

Perhaps this is -X, --exit-empty. Arguably we could overload the existing -x with this meaning, but I imagine someone may have made a menu system or something out of it for which this would be a breaking change.

A new flag would be better so as to not break backwards-compatibility

I will make a PR with what I have done already. I don't know much of C, so there might be better ways to do it. If there are, please point them out and I will be more than happy to correct them.

adding a once-each to my existing solution seems to be quite straight forward.

from dragon.

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.