diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-08-06 14:57:37 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-08-06 14:57:52 +0200 |
commit | 171c1f519b902e1654e17bd33cb129569478f7f7 (patch) | |
tree | ee44e91b4329777f6ad02218d32333175f98cfc5 | |
parent | d22b27180eb394f9443860ccdf2656d2fdef56ed (diff) |
don't create temp file
-rwxr-xr-x | bin/menuscripts/mhelp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/bin/menuscripts/mhelp b/bin/menuscripts/mhelp index e03222b..5963a88 100755 --- a/bin/menuscripts/mhelp +++ b/bin/menuscripts/mhelp @@ -1,5 +1,4 @@ #!/usr/bin/env sh -OPTIONS="/tmp/dmh_options.txt" if [ "$MENUCMD" = "tofi" ] then @@ -16,18 +15,15 @@ fi test -z "$program" && exit 1 -if $program --help > "$OPTIONS" -then - option="$(grep "^ *-[-a-zA-Z0-9]* " "$OPTIONS" | - tr -s ' ' | - sort | - uniq | - column -l 2 -t | - $menucmd | - awk '{print $1}')" -fi +option="$($program --help | + # Parse options + grep "^ *-[-a-zA-Z0-9]* " | + tr -s ' ' | + sort | uniq | + column -l 2 -t | + $menucmd | + awk '{print $1}')" test -z "$option" && exit 1 -rm -f "$OPTIONS" setsid $program $option |