Giter Club home page Giter Club logo

Comments (4)

maaslalani avatar maaslalani commented on May 14, 2024

Hey!

P.S. Thanks for the tool - it's awesome. Yesterday I integrated in some of my fish functions for administration and it's so much nicer to use now!

Thank you for the kind words!

You can actually accomplish this with pure shell scripting, here is an example:

https://github.com/charmbracelet/gum/blob/main/examples/filter-key-value.sh

export LIST=$(cat <<END
Cow:Moo
Cat:Meow
Dog:Woof
END)

ANIMAL=$(echo "$LIST" | cut -d':' -f1 | gum filter)
SOUND=$(echo "$LIST" | grep $ANIMAL | cut -d':' -f2)

echo "The $ANIMAL goes $SOUND"

This allows everyone to use whatever delimiters they want and makes it much more flexible instead of prescribing a solution with flags inside of gum.

from gum.

dector avatar dector commented on May 14, 2024

😢 That's not really the same and MUCH LESS readable. But thanks for the suggestion.

from gum.

maaslalani avatar maaslalani commented on May 14, 2024

That's not really the same

Hmm, I may have misinterpreted your original example then. Could you elaborate on what you are trying to do and I can try and put together a more readable example for you?

from gum.

dector avatar dector commented on May 14, 2024

No, it seems that your interpretation was correct. :)

However, gum choose doesn't have search bar and have multi-selection and it "feels" different than gum filter.

I'll implement new behavior for myself anyway and then I can show the code - maybe you'll reconsider. :)

Thanks.

from gum.

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.