Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Zsh Rosetta Stone / ExplainShell equivalent



Has anybody written a "zsh wtf" style tool where a complex _expression_ is annotated, similar to "explainshell.com"?

The more I learn about Zsh, the more obscure and hard-to-read my code is.

$ command date
Tue Nov 23 20:17:53 CST 2021

$ ls -la *(.Dmm-3)
-rw-r--r-- 1 zachriggle staff 0 Nov 23 20:17 file_10
-rw-r--r-- 1 zachriggle staff 0 Nov 23 20:15 file_8
-rw-r--r-- 1 zachriggle staff 0 Nov 23 20:16 file_9

Is definitely very convenient -- but only if you know what's going on.  Other, more documented commands can achieve roughly the same thing.

$ find . -Bmin -3 -type f -maxdepth 1 | xargs ls -la
-rw-r--r--  1 zachriggle  staff  0 Nov 23 20:17 ./file_10
-rw-r--r--  1 zachriggle  staff  0 Nov 23 20:15 ./file_8
-rw-r--r--  1 zachriggle  staff  0 Nov 23 20:16 ./file_9

Is there any interest in something like ExplainShell or ShellCheck for Zsh?  I'm not sure what tools are best fit for parsing things like complicated expressions.

Zach Riggle



Messages sorted by: Reverse Date, Date, Thread, Author