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

Re: Zsh Rosetta Stone / ExplainShell equivalent



Zach Riggle wrote on Tue, Nov 23, 2021 at 20:58:52 -0600:
> $ ls -la *(.Dmm-3)
⋮
> 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.

Truncating the command line after each character and doing headless
completions (https://github.com/Valodim/zsh-capture-completion) might be
a good start.

For --options to builtins you could potentially make it a lot smarter by
looking in the manual sources.  Given «foo -x», jump to the
[a-z]index(foo) line, then show either the «item(tt(-x))», if there is
one, or the output of a sentence-wise grep for «tt(-x)» (taking the
parentheses as literals).

As to your question, you might've gotten better answers if you'd given
a self-contained description (or at least examples) of the proposed
functionality.

Cheers,

Daniel




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