Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow equals sign in aliased parameter values. #2755

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

dpnova
Copy link

@dpnova dpnova commented May 16, 2024

Type

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Proposal to allow aliased parameter values to contain an equals sign. for example, something like: -c formula=x=1+1

An alternative could be to have a way to escape the value, though that opens a shell can of worms.

Opening this as a draft as a way to get comments before I go and dig into the failing tests this causes. (I realise some may disagree with this change)

Here's an example with a better description:

Say you have a field formula you would like to hold a string that contains an equals character. As per the example above, the formula could be x=x+1. The desired outcome would be the equivalent of this ts: const formula = "x=x+1".

This case is articulated in the test I believe, though I could be wrong :)

Cheers!

Copy link

changeset-bot bot commented May 16, 2024

⚠️ No Changeset found

Latest commit: dfdd5bc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@gcanti gcanti added the cli label May 16, 2024
@dpnova dpnova marked this pull request as ready for review July 1, 2024 13:00
@@ -1193,7 +1193,7 @@ const parseInternal = (
const extractKeyValue = (
value: string
): Effect.Effect<[string, string], ValidationError.ValidationError> => {
const split = value.trim().split("=")
const split = value.trim().split(/=(.*)/, 2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind using Regex, but let's extract this to a constant in the global scope so the regex doesn't get re-created with each invocation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Waiting on Author
Development

Successfully merging this pull request may close these issues.

None yet

3 participants