Giter VIP home page Giter VIP logo

Comments (7)

mmlb avatar mmlb commented on August 18, 2024

hmm on the other hand https://www.gnu.org/software/bash/manual/html_node/Shell-Functions.html#Shell-Functions list it as optional 😓

from sh.

mvdan avatar mvdan commented on August 18, 2024

Surely you mean when they are formatted?

Using () in the bash style is valid syntax and works in bash. The reason behind using it, besides consistency, is so that the format is less confusing. See 8f92740.

from sh.

mvdan avatar mvdan commented on August 18, 2024

To expand on the commit above - if we don't introduce (), we would break the following program:

function foo() (bar)

(subshells as function bodies are valid).

from sh.

mmlb avatar mmlb commented on August 18, 2024

Right. Sorry, checked issues but not the code :(. Guess its time to dig into sh.vim I think

from sh.

mvdan avatar mvdan commented on August 18, 2024

No problem :) Just wanted to point out why I was forced to do this. I too was trying not to use () in this case.

from sh.

mmlb avatar mmlb commented on August 18, 2024

Yep it makes sense and TBH it's not the first time I've run into this issue.

from sh.

mmlb avatar mmlb commented on August 18, 2024

just fyi for anyone else using (neo)vim and hitting this, updating indent/sh.vim via https://github.com/chrisbra/vim-sh-indent either as a plugin or once it gets pulled into vim works.

from sh.

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.