3 ms·
aaah, that's a great idea for interleaving comments, I'll have to use that! thanks! previously I've done this, which works, but is a bit....... yeah. som
by Groxx 4y ago
aaah, that's a great idea for interleaving comments, I'll have to use that! thanks!
previously I've done this, which works, but is a bit....... yeah.
some command \
`# did you know comments work inside backticks like this?` \
--complex_flag_needing_descriptions=... \
`# literally any ffmpeg flag` \
--lol no
now if only shellcheck would support zsh....
- remram 4y agoFor completeness, the other option is: CMD="some command" # Some comment CMD="$CMD --verbose --complex-flag=..." # Other stuff CMD="$CMD --lol=\"no thanks\"" eval $CMD
- Groxx 4y agoyeah, I just don't like dealing with the possibly-multiple-levels of escaping that sometimes requires :\ there are ways to deal with that of course, but it's kinda unavoidably more complex.
- Beltalowda 4y ago> now if only shellcheck would support zsh Since the default zsh behaviour is much more reasonable (e.g. just $foo won't do globbing or word splitting) and you don't really need POSIX compatibility if you're going to use zsh-specific features, the need for shellcheck is hugely less than what you need with bash or POSIX sh.
- nerdponx 4y agoStill, it would be pretty handy. For example a good Zsh linter could warn you if you use a Bashism that isn't valid in Zsh, or it could switch to Posix mode if you set `emulate sh`, or warn you when an autoload function file is missing its function call at the bottom, etc.
- Beltalowda 4y agoSure, but that's "only" useful warnings/errors of that kind that are useful for any language, rather than footguns that work on first approximation and then don't ($*, unquoted $@, unquoted $var, stuff like that). A zsh LSP would be nice as well.
- nerdponx 4y agoVery fair! I bet you could use the C "module" interface to write the Zsh LSP in Zsh itself...
- Beltalowda 4y agoThere's https://github.com/zsh-users/zsh-syntax-highlighting https://github.com/zsh-users/zsh-syntax-highlighting which does some parsing, but I never looked at the details of it (I just know it exists).