Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CLI cheatsheet script #1694

Merged
merged 4 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bin/scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
16 changes: 16 additions & 0 deletions bin/scripts/cheatsheet.sh
Original file line number Diff line number Diff line change
@@ -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