github.com/facebookincubator/ttpforge@v1.0.13-0.20240405153150-5ae801628835/example-ttps/args/regexp.yaml (about)

     1  ---
     2  api_version: 2.0
     3  uuid: f3328ba0-45f9-4e9f-92c7-7d064a1a0e4a
     4  name: Regular Expression Validation for Command-Line Arguments
     5  description: |
     6    You can require user-provided command-line arguments
     7    to match a provided regular expression.
     8    Golang regexp syntax documentation: https://pkg.go.dev/regexp/syntax
     9    NOTE: `regexp` is only supported for arguments of type `string` (the default)
    10  args:
    11    - name: must_contain_ab
    12      description: requirement satisfied if `ab` occurs anywhere in the string
    13      regexp: ab
    14    - name: must_start_with_1_end_with_7
    15      type: string
    16      description: requirement satisfied if argument starts with `1` and ends with `7`
    17      regexp: ^1.*7$
    18  steps:
    19    - name: valid_args_provided
    20      print_str: |
    21        Valid value for arg `must_contain_ab`: {{.Args.must_contain_ab}}
    22        Valid value for arg `must_start_with_1_end_with_9`: {{.Args.must_start_with_1_end_with_7}}