Giter Site home page Giter Site logo

Parse boolean values about nushell HOT 7 CLOSED

nushell avatar nushell commented on May 3, 2024
Parse boolean values

from nushell.

Comments (7)

COLAMAroro avatar COLAMAroro commented on May 3, 2024 3

Using $true and $false doesn't seems that bad, considering the use of $it when piping and the inspiration from PowerShell

from nushell.

wycats avatar wycats commented on May 3, 2024

PowerShell makes this work by reserving $true and $false. Earlier on, I was thinking $yes and $no. I'm open to other options.

from nushell.

rrichardson avatar rrichardson commented on May 3, 2024

are there any characters/symbols already reserved in nushell? I am disinclined to use $ because it might be misleading to newcomers from bash|zsh|csh|etc
I kind of like :true :false but am not set on it

from nushell.

alexxbb avatar alexxbb commented on May 3, 2024

What if we distinct a comparison with literals versus logical operation on values? i.e:
ls | where type is File - literal
ls | where size > 10kb - logical
read something | where yanked != true - logical

from nushell.

olamiko avatar olamiko commented on May 3, 2024

I will like to handle this but which mode should I work with? $true or :true?

from nushell.

rrichardson avatar rrichardson commented on May 3, 2024

@olamiko - I think this feature was just released.

from nushell.

thegedge avatar thegedge commented on May 3, 2024

Yep, @jonathandturner added $true and $false:

❯ ls --full | where readonly
❯ ls --full | where readonly == $false

There's currently no shorthand for boolean negation, so this doesn't work:

❯ ls --full | where !readonly

from nushell.

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.