github.com/upcmd/up@v0.8.1-0.20230108151705-ad8b797bf04f/tests/functests/c0142.yml (about)

     1  doc_meta: |
     2    folder: cmd-func
     3    title: color print
     4    head: |
     5      Showcase a extended color print cmd, it is a improved cmd to support color printing for both plain text message, template rendering message and object
     6  
     7    sections:
     8      - title: Demo
     9        log: yes
    10  
    11  tasks:
    12    -
    13      name: task
    14      task:
    15  
    16        - func: cmd
    17          vars:
    18            person:
    19              name: tom
    20              age: 18
    21            objectname: person
    22          do:
    23            - name: colorPrint
    24              cmd:
    25                msg: hello, world
    26                bg: blue
    27                fg: white
    28  
    29            - name: colorPrint
    30              cmd:
    31                msg: hello, world
    32                bg: yellow
    33  
    34            - name: colorPrint
    35              cmd:
    36                msg: hello, world
    37                fg: white
    38  
    39            - name: colorPrint
    40              cmd:
    41                msg: hello, world
    42  
    43            - name: colorPrint
    44              cmd:
    45                msg: '{{.person.name}}: {{.person.age}}'
    46                fg: blue
    47                bg: red
    48  
    49            - name: colorPrint
    50              cmd:
    51                object: 'person'
    52                fg: blue
    53                bg: black
    54  
    55            - name: colorPrint
    56              cmd:
    57                object: '{{.objectname}}'
    58                fg: blue
    59                bg: green
    60  
    61            - name: colorPrint
    62              cmd:
    63                object: 'person'
    64                msg: 'person'
    65                fg: blue
    66                bg: black