elseif statement #134

Closed
maxfl opened this Issue Jun 15, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@maxfl
Contributor

maxfl commented Jun 15, 2012

I wonder why fish doesn't have 'elseif' statement.
I think it is very useful thing. Event in case of one nested if statement, it saves one identation level and makes it easier to follow closing 'end's.

@ridiculousfish

This comment has been minimized.

Show comment
Hide comment
@ridiculousfish

ridiculousfish Sep 3, 2012

Member

I first implemented this as a new builtin, "elseif," but then decided I didn't like that. All fish builtins are real words. So now it's "else if":

if false
    echo "Branch 1"
else if true
    echo "Branch 2"
else
    echo "Branch 3
end

Docs updated too.

To git@github.com:fish-shell/fish-shell.git
ff12446..1a59346 master -> master

Member

ridiculousfish commented Sep 3, 2012

I first implemented this as a new builtin, "elseif," but then decided I didn't like that. All fish builtins are real words. So now it's "else if":

if false
    echo "Branch 1"
else if true
    echo "Branch 2"
else
    echo "Branch 3
end

Docs updated too.

To git@github.com:fish-shell/fish-shell.git
ff12446..1a59346 master -> master

@maxfl

This comment has been minimized.

Show comment
Hide comment
@maxfl

maxfl Sep 5, 2012

Contributor

That's cool. Thank you.

Contributor

maxfl commented Sep 5, 2012

That's cool. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment