Skip to content

fix incompatible zsh syntax used in bash#260

Closed
akeeman wants to merge 1 commit intopython-poetry:mainfrom
akeeman:patch-1
Closed

fix incompatible zsh syntax used in bash#260
akeeman wants to merge 1 commit intopython-poetry:mainfrom
akeeman:patch-1

Conversation

@akeeman
Copy link
Copy Markdown

@akeeman akeeman commented Sep 21, 2022

bash can't use

case EXPRESSION in (case) COMMAND-LIST;; ... esac
                   ^
                    '- invalid syntax

bash case grammar:

case EXPRESSION in CASE1) COMMAND-LIST;; CASE2) COMMAND-LIST;; ... CASEN) COMMAND-LIST;; esac

It's probably mistaken for zsh syntax:

case word in [ [(] pattern [ | pattern ] ... ) list (;;|;&|;|) ] ... esac

Sources:

@akeeman
Copy link
Copy Markdown
Author

akeeman commented Sep 21, 2022

Note that the test error is not related to this pr

@akeeman
Copy link
Copy Markdown
Author

akeeman commented Sep 21, 2022

In poetry this generates

cache clear)

so quoting a case that contains a space is not working well

@Secrus
Copy link
Copy Markdown
Member

Secrus commented Sep 21, 2022

In poetry this generates

cache clear)

so quoting a case that contains a space is not working well

Poetry is still on older version of Cleo, which doesn't have the fixes applied.

@akeeman
Copy link
Copy Markdown
Author

akeeman commented Sep 21, 2022

Ah, I see. Actually, the quoting seems to fix the problem entirely. I wasn't aware bash supported the leading opening parentheses.

(But here it is in the docs.)

@akeeman akeeman closed this Sep 21, 2022
@akeeman akeeman deleted the patch-1 branch September 21, 2022 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants