Skip to content

Commit b9d6b12

Browse files
committed
de-esphome usage
1 parent 809e295 commit b9d6b12

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Some possible dehash command variants are:
5656

5757
idmerge.sh
5858
===========
59-
idmerge.sh: read yaml and output merged yaml using an id tag.
59+
idmerge.sh: merge yaml common blocks with an id: tag
6060

6161
Usage
6262
-----

idmerge.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
# idmerge.sh: read esphome yaml and output merged esphome yaml.
3+
# idmerge.sh: merge yaml common blocks with an id: tag
44

55
# Common blocks are merged backwards in the output by referencing tags
66
# specified in "id: <tag>" yaml lines. The first common block to
@@ -13,7 +13,7 @@
1313
# Usage: idmerge.sh -id <idTag> <input.yaml >output.yaml
1414

1515
# After running idmerge.sh, it is advised to postprocess the yaml with
16-
# awk '/^[[:alnum:]_]/{print "---"} | yq '... comments=""' esphome.yaml
16+
# awk '/^[[:alnum:]_]/{print "---"} | yq '... comments=""' file.yaml
1717
# before piping it into yq to merge sections using:
1818

1919
# yq eval-all '. as $item ireduce ({}; . *+ $item)'
@@ -26,7 +26,7 @@
2626
# Require all variables to be declared - to catch variable typos early.
2727

2828
declare -r me=${0##*/} # basename of this script
29-
declare -r usage="$me: read yaml and output merged yaml using an id tag.
29+
declare -r usage="$me: merge yaml common blocks with an id: tag
3030
3131
Usage: $me: [-q] [-p] [-m] [-h] [-t tag] [-o outfile] <file.yaml>\n
3232
-t|--tag\tItem tag that uniquely names what to merge. Defaults to "id".
@@ -124,7 +124,7 @@ declare -a -i block_from # block first line number
124124
declare -a -i block_to # block last line number
125125
declare -a -i block_idline # block "id:" line if it has one, else zero
126126

127-
# These read-only strings are used to identify special esphome yaml lines.
127+
# These read-only strings are used to identify special yaml lines.
128128

129129
declare -r newdoc="---"
130130
declare -r is_array='^[[:blank:]]*- ([[:alnum:]: _]+)[[:blank:]]*$'
@@ -135,7 +135,7 @@ declare -r is_comment='^[[:blank:]]*#.*$'
135135
declare -r is_blank='^[[:blank:]]*$'
136136
declare -r get_mapname='^([[:alnum:]_]+):.*$'
137137

138-
# This function reads in esphome yaml on stdin.
138+
# This function reads in yaml on stdin.
139139

140140
read_lines () {
141141
declare -i n=0

0 commit comments

Comments
 (0)