diff --git a/bin/scripts/README.md b/bin/scripts/README.md index 0dd88b4e8f..911e503d3b 100644 --- a/bin/scripts/README.md +++ b/bin/scripts/README.md @@ -4,6 +4,7 @@ Note: Usually you need to call the scripts in this directory while actually bein * `archive-font-patcher.sh`: Archives the font patcher script and subscripts and the required source glyph files [1] * `archive-fonts.sh`: Creates the release zip file of one or more font(s) from existing `patched-fonts/` content [1] +* `cheatsheet.sh`: Search for a glyph by part of its name [4] * `data/`: Contains plain text files used to generate the CSS and cheat sheet files * `data/sankey/`: Contains instructions on how to create the sankey glyph table manually [3] * `docker-entrypoint.sh`: This script is packaged into the docker container and is usually used to start patching [2] diff --git a/bin/scripts/cheatsheet.sh b/bin/scripts/cheatsheet.sh new file mode 100755 index 0000000000..761260696a --- /dev/null +++ b/bin/scripts/cheatsheet.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# Nerd Fonts Version: 3.2.1 +# Script Version: 1.0.0 +# +# Search for a glyph by part of its name in all patchsets +# Usage: ./cheatsheet.sh divider + +# shellcheck disable=SC1091 # Do not pull in the sourced file +source ./lib/i_all.sh + +# Search the key on the declared variables +for glyph in ${!i_*}; do + if [[ "$glyph" == *"$1"* ]]; then + printf "%s\t%x\t%s\n" "${!glyph}" "'${!glyph}'" "$glyph" + fi +done