Update: man() bash function
This commit is contained in:
parent
61fc56a8ea
commit
f3121d12e1
|
@ -57,8 +57,21 @@ sww() {
|
||||||
man() {
|
man() {
|
||||||
local command=$(IFS=-, ; echo "$*")
|
local command=$(IFS=-, ; echo "$*")
|
||||||
|
|
||||||
if [[ "$command" =~ \. ]]; then
|
# When section is specified,override
|
||||||
~/.configs_pointer/bin/man_py.sh "$command"
|
if [[ "$1" =~ ^[1-7]$ ]]; then
|
||||||
|
local -ri section="$1"
|
||||||
|
|
||||||
|
shift
|
||||||
|
command=$(IFS=-, ; echo "$*")
|
||||||
|
|
||||||
|
/usr/bin/man "$section" "$command"
|
||||||
|
return $?
|
||||||
|
fi
|
||||||
|
|
||||||
|
local manpy=~/.configs_pointer/bin/man_py.sh
|
||||||
|
|
||||||
|
if [[ "$command" =~ \. ]] && "$manpy" "$command" &>/dev/null; then
|
||||||
|
"$manpy" "$command"
|
||||||
elif /usr/bin/man "$command" >/dev/null 2>&1; then
|
elif /usr/bin/man "$command" >/dev/null 2>&1; then
|
||||||
/usr/bin/man "$command"
|
/usr/bin/man "$command"
|
||||||
elif command -v "$command" &>/dev/null; then
|
elif command -v "$command" &>/dev/null; then
|
||||||
|
|
Loading…
Reference in a new issue