================================================================================
# empty object
$ kubectl get pod -o yaml
================================================================================

{}
key: {}

--------------------------------------------------------------------------------

{}
[96mkey[0m: {}

================================================================================
# empty array
$ kubectl get pod -o yaml
================================================================================

[]
key: []

--------------------------------------------------------------------------------

[]
[96mkey[0m: []

================================================================================
# array of values
$ kubectl get pod -o yaml
================================================================================

values:
  - true
  - null
  - unquoted string
  - "quoted string"
  - 'single-quoted string'
  - 123
  - {}
  - []
  - # comment

--------------------------------------------------------------------------------

[96mvalues[0m:
  - [32mtrue[0m
  - [90;3mnull[0m
  - [93munquoted string[0m
  - "[93mquoted string[0m"
  - '[93msingle-quoted string[0m'
  - [35m123[0m
  - {}
  - []
  - [93m# comment[0m

================================================================================
# values can be colored by its type
$ kubectl get pod -o yaml
================================================================================

apiVersion: v1
kind: "Pod"
num: 415
unknown: <unknown>
none: <none>
bool: true

--------------------------------------------------------------------------------

[96mapiVersion[0m: [93mv1[0m
[96mkind[0m: "[93mPod[0m"
[96mnum[0m: [35m415[0m
[96munknown[0m: [90;3m<unknown>[0m
[96mnone[0m: [90;3m<none>[0m
[96mbool[0m: [32mtrue[0m

================================================================================
# key color changes based on its indentation
$ kubectl get pods -o yaml
================================================================================

apiVersion: v1
items:
- apiVersion: v1
  key:
  - key2: 415
    key3: true
  key4:
    key: val

--------------------------------------------------------------------------------

[96mapiVersion[0m: [93mv1[0m
[96mitems[0m:
- [36mapiVersion[0m: [93mv1[0m
  [36mkey[0m:
  - [96mkey2[0m: [35m415[0m
    [96mkey3[0m: [32mtrue[0m
  [36mkey4[0m:
    [96mkey[0m: [93mval[0m

================================================================================
# elements in an array can be colored
$ kubectl get pods -o yaml
================================================================================

lifecycle:
  preStop:
    exec:
      command:
      - sh
      - c
      - sleep 30

--------------------------------------------------------------------------------

[96mlifecycle[0m:
  [36mpreStop[0m:
    [96mexec[0m:
      [36mcommand[0m:
      - [93msh[0m
      - [93mc[0m
      - [93msleep 30[0m

================================================================================
# a value contains dash
$ kubectl get pods -o yaml
================================================================================

apiVersion: v1
items:
- apiVersion: v1
  key:
  - key2: 415
    key3: true
  key4:
    key: -val

--------------------------------------------------------------------------------

[96mapiVersion[0m: [93mv1[0m
[96mitems[0m:
- [36mapiVersion[0m: [93mv1[0m
  [36mkey[0m:
  - [96mkey2[0m: [35m415[0m
    [96mkey3[0m: [32mtrue[0m
  [36mkey4[0m:
    [96mkey[0m: [93m-val[0m

================================================================================
# a long string which is broken into several lines can be colored
$ kubectl get pods -o yaml
================================================================================

- apiVersion: v1
  kind: Pod
  metadata:
    annotations:
      annotation.long.1: 'Sometimes, you may want to specify what to command to use as kubectl.
        For example, when you want to use a versioned-kubectl kubectl.1.17, you can do that by an environment variable.'
      annotation.long.2: kubecolor colorizes your kubectl command output and does nothing else.
        kubecolor internally calls kubectl command and try to colorizes the output so you can use kubecolor as a
        complete alternative of kubectl
      annotation.short.1: normal length annotation

--------------------------------------------------------------------------------

- [36mapiVersion[0m: [93mv1[0m
  [36mkind[0m: [93mPod[0m
  [36mmetadata[0m:
    [96mannotations[0m:
      [36mannotation.long.1[0m: '[93mSometimes, you may want to specify what to command to use as kubectl.[0m
        [93mFor example, when you want to use a versioned-kubectl kubectl.1.17, you can do that by an environment variable.[0m'
      [36mannotation.long.2[0m: [93mkubecolor colorizes your kubectl command output and does nothing else.[0m
        [93mkubecolor internally calls kubectl command and try to colorizes the output so you can use kubecolor as a[0m
        [93mcomplete alternative of kubectl[0m
      [36mannotation.short.1[0m: [93mnormal length annotation[0m

================================================================================
# quoted string
$ kubectl get configmap test -oyaml
================================================================================

double: "v1"
single: 'v1'
doubleInDouble: "foo"bar"
singleInSingle: 'foo'bar'
multilineDoubleQuoted: "foo
  bar
  moo"
multilineSingleQuoted: 'foo
  bar
  moo'

--------------------------------------------------------------------------------

[96mdouble[0m: "[93mv1[0m"
[96msingle[0m: '[93mv1[0m'
[96mdoubleInDouble[0m: "[93mfoo"bar[0m"
[96msingleInSingle[0m: '[93mfoo'bar[0m'
[96mmultilineDoubleQuoted[0m: "[93mfoo[0m
  [93mbar[0m
  [93mmoo[0m"
[96mmultilineSingleQuoted[0m: '[93mfoo[0m
  [93mbar[0m
  [93mmoo[0m'

================================================================================
# does not swallow quote character (issue #179)
$ kubectl get configmap test -oyaml
================================================================================

apiVersion: v1
data:
  data: |
    foo = "bar"
kind: ConfigMap
metadata:
  name: test
  namespace: spire

--------------------------------------------------------------------------------

[96mapiVersion[0m: [93mv1[0m
[96mdata[0m:
  [36mdata[0m: |
    [93mfoo = "bar"[0m
[96mkind[0m: [93mConfigMap[0m
[96mmetadata[0m:
  [36mname[0m: [93mtest[0m
  [36mnamespace[0m: [93mspire[0m

================================================================================
# multiline string
$ kubectl get pod -o yaml
================================================================================

data: |
  foo: bar
  moo: doo
moreData: |
  roo: |
    baz: 123
    roomba: {}

--------------------------------------------------------------------------------

[96mdata[0m: |
  [93mfoo: bar[0m
  [93mmoo: doo[0m
[96mmoreData[0m: |
  [93mroo: |[0m
  [93m  baz: 123[0m
  [93m  roomba: {}[0m

================================================================================
# multiline string with indent indicator
$ kubectl get pod -o yaml
================================================================================

withoutIndicator: |
    foo: bar
  foo: bar
withIndicator: |2
    foo: bar
  foo: bar
crazy: >+4
    foo: bar
  foo: bar

--------------------------------------------------------------------------------

[96mwithoutIndicator[0m: |
    [93mfoo: bar[0m
  [36mfoo[0m: [93mbar[0m
[96mwithIndicator[0m: |[35m2[0m
  [93m  foo: bar[0m
  [93mfoo: bar[0m
[96mcrazy[0m: >+[35m4[0m
    [93mfoo: bar[0m
  [36mfoo[0m: [93mbar[0m
