Skip to content

Variable override does not work #232

@legal90

Description

@legal90

Bug Report

1. Minimal reproduce step (Required)

Example from the official doc:
https://www.kcl-lang.io/docs/reference/lang/tour#kcl-cli-variable-override

schema Person:
    name: str
    age: int
    ids?: [int]

person = Person {
    name = "Alice"
    age = 10
}

2. What did you expect to see? (Required)

With a string and integer values

kcl main.k -O :person.name=\"Bob\" -O :person.age=10

Expected Output:

person:
  name: Bob
  age: 10

With a list value

kcl main.k -O :person.ids=\[1,2\]

Expected Output:

person:
  name: Alice
  age: 10
  ids:
    - 1
    - 2

3. What did you see instead (Required)

With a string value

kcl main.k -O :person.name=\"Bob\" -O :person.age=10

Received Output:

Error: invalid argument ":person.name=\"Bob\"" for "-O, --overrides" flag: parse error on line 1, column 14: bare " in non-quoted-field

With a list value

kcl main.k -O :person.ids=\[1,2\]

Received Output:

Error: Invalid spec format ':person.ids=[1', expected <field_path>=filed_value>, <field_path>:filed_value>, <field_path>+=filed_value> or <field_path>-

4. What is your KCL components version? (Required)

$ kcl --version
kcl version v0.11.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions