Commit Graph

3 Commits

Author SHA1 Message Date
065686f341 spam-ascii: "*" dumps entire ~/ascii; alias quotes $0 to preserve it
Some checks failed
Close stale issues / stale (push) Has been cancelled
2026-04-22 07:00:52 -07:00
079bee5774 spam-ascii: pass -L to find so it dereferences ~/ascii when symlinked
Some checks failed
Close stale issues / stale (push) Has been cancelled
~/ascii is a symlink to ~/.yadr/ascii. Without -L, 'find <symlink>'
treats the link itself as the starting point, -type f rules it out,
and fuzzy matches return nothing.
2026-04-21 10:01:08 -07:00
4813512731 spam-ascii: fuzzy-match helper for /spam alias
New .local/bin/spam-ascii POSIX shell script: resolves a pattern to
a file in ~/ascii with this order:

  1. exact filename match
  2. exact name + common ASCII-art extension (.txt/.ans/.asc)
  3. first case-insensitive substring match (sorted alphabetically)

Non-zero exit + stderr-ish error if nothing matches, so /spam
prints 'no match in ~/ascii for: <pattern>' instead of spewing
a missing-file error.

Rewire the irssi /spam alias to call the script instead of
hardcoding 'cat ~/ascii/$0'. Now:

  /spam mario     -> matches ~/ascii/mario.txt or ~/ascii/Mario_art.ans
  /spam MARIO     -> case-insensitive
  /spam nothere   -> 'no match in ~/ascii for: nothere'
2026-04-21 09:48:40 -07:00