github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/integrations/terraform_any.mx (about)

     1  !if { man-summary terraform } then {
     2      summary terraform "Write, Plan, and Create Infrastructure as Code"
     3  }
     4  
     5  private autocomplete.terraform {
     6      cast json
     7      config set proc strict-arrays false
     8  
     9      if { $1 == "workspace" && $2 == "select" } then {
    10          terraform workspace list \
    11          -> regexp (s/^[\s\*]+//) \
    12          -> [..-2] -> suffix ': "Terraform workspace"' \
    13          -> grep -v "^:" \
    14          -> cast yaml \
    15          -> format json
    16  
    17      } else {
    18          terraform -help @PARAMS \
    19          -> tabulate --map --column-wraps --key-inc-hint
    20      }
    21  }
    22  
    23  test unit private autocomplete.terraform %{
    24      StdoutType:        json
    25      StdoutGreaterThan: 10
    26  	StdoutIsMap:       true
    27  }
    28  
    29  autocomplete: set terraform %[
    30      {
    31          DynamicDesc: '{
    32              config set proc strict-arrays false
    33              autocomplete.terraform @PARAMS
    34          }'
    35          AllowMultiple: true
    36          AllowAny:      true
    37          ListView:      true
    38          CacheTTL:      60
    39      }
    40  ]