noctuid / zscroll

A text scroller for panels or terminals
GNU General Public License v3.0
198 stars 10 forks source link

Add support for in-shell execution #15

Closed bytedream closed 3 years ago

bytedream commented 3 years ago

This adds 2 new arguments, -i / --insecure-match and -I / --insecure-command. With -i, everything given in --match-command and --match-text will be executed in shell which allows the use of environment variables (like $PWD) or other shell related actions (e.g. call of another script) in it. For -I it's the same, except that not the commands in --match-command and --match-text are executed in shell, but the positional argument.

Execution in shell could lead to unwanted command injection because this should only be used if necessary (which led to the naming of the new arguments)

bytedream commented 3 years ago

The new commit summarized the two commands to -e/--eval-in-shell and integrated tests. man page typo was fixed too and added an example to it.

noctuid commented 3 years ago

One more thing: Only the match command is evaluated, not the match text too, right? Could you remove the mentions of --match-text from the documentation?

bytedream commented 3 years ago

One more thing: Only the match command is evaluated, not the match text too, right? Could you remove the mentions of --match-text from the documentation?

Oh, missed (and fixed) that. Somehow I thought that is also matched