Skip to content

Commit

Permalink
Readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
grasmash committed May 9, 2022
1 parent 0a05b10 commit 83b0b7e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,25 @@ Yet another command line tool for reading and manipulating yaml files, built on
./vendor/bin/yaml-cli update:key somefile.yml old-key new-key
./vendor/bin/yaml-cli update:value somefile.yml some-key some-value

# Cast to boolean.
./vendor/bin/yaml-cli update:value somefile.yml some-key false
./vendor/bin/yaml-cli update:value somefile.yml some-key true
./vendor/bin/yaml-cli update:value somefile.yml some-key 0 --type=boolean
./vendor/bin/yaml-cli update:value somefile.yml some-key 0 --type=bool

# Cast to null.
./vendor/bin/yaml-cli update:value somefile.yml some-key null
./vendor/bin/yaml-cli update:value somefile.yml some-key ~ --type=null

# Cast to integer.
./vendor/bin/yaml-cli update:value somefile.yml some-key 1 --type=integer
./vendor/bin/yaml-cli update:value somefile.yml some-key 1 --type=int

# Cast to float/double/real.
./vendor/bin/yaml-cli update:value somefile.yml some-key 1.0 --type=float
./vendor/bin/yaml-cli update:value somefile.yml some-key 1.0 --type=double
./vendor/bin/yaml-cli update:value somefile.yml some-key 1.0 --type=real

### Similar tools:

- Javascript - https://github.com/pandastrike/yaml-cli
Expand Down
1 change: 1 addition & 0 deletions tests/phpunit/UpdateValueCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public function getValueProvider(): array
[$file, 'string.1', 'true', 'string', 'true', "The value for key 'string.1' was set to 'true' (string) in $file.", 0],
[$file, 'string.2', 'null', 'string', 'null', "The value for key 'string.2' was set to 'null' (string) in $file.", 0],
[$file, 'null.0', 'null', null, null, "The value for key 'null.0' was set to 'null' (NULL) in $file.", 0],
[$file, 'null.0', '~', 'null', null, "The value for key 'null.0' was set to '~' (NULL) in $file.", 0],
[$file, 'float.0', '1.0', 'float', 1.0, "The value for key 'float.0' was set to '1.0' (double) in $file.", 0],
[$file, 'float.1', '1.0', 'double', 1.0, "The value for key 'float.1' was set to '1.0' (double) in $file.", 0],
[$file, 'float.2', '1.0', 'real', 1.0, "The value for key 'float.2' was set to '1.0' (double) in $file.", 0],
Expand Down

0 comments on commit 83b0b7e

Please sign in to comment.