summaryrefslogtreecommitdiff
path: root/bin/menuscripts/mhelp
blob: 339d6bf507d129a134674988018513b089961a7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env sh

program="$(commander -r -c -d)"

[ "$program" ] || exit 1

option="$("$program" --help |
	# Parse options
	grep "^ *-[-a-zA-Z0-9]* " |
	tr -s ' ' |
	sort | uniq |
	column -l 2 -t |
	commander -l -x -c -d |
	awk '{print $1}')"

[ "$option" ] || exit 1

setsid "$program" "$option"