Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions bin/omarchy
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ remaining_has_help_flag() {

for token in "$@"; do
[[ $token == "--" ]] && break
[[ $token == "--help" || $token == "-h" ]] && return 0
[[ $token == "--help" || $token == "-h" || $token == "?" ]] && return 0
done

return 1
Expand Down Expand Up @@ -896,6 +896,15 @@ show_group_help() {

show_prefix_help() {
local prefix="$1"
local word=""
local prefix_words=()

for word in $prefix; do
[[ $word == "--help" || $word == "-h" || $word == "?" ]] && continue
prefix_words+=("$word")
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved
done
prefix=$(join_words " " "${prefix_words[@]}")
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved

local prefix_with_space="$prefix "
local key=""
local rows=""
Expand Down Expand Up @@ -1084,7 +1093,7 @@ dispatch_fast_or_help() {
return 0
fi

if (( $# >= 2 )) && [[ $2 == "--help" || $2 == "-h" ]] && group_has_binary_commands "$1"; then
if (( $# >= 2 )) && [[ $2 == "--help" || $2 == "-h" || $2 == "?" ]] && group_has_binary_commands "$1"; then
load_group_commands "$1"
show_group_help "$1"
return 0
Expand Down Expand Up @@ -1147,7 +1156,7 @@ dispatch_or_help() {
return 0
fi

if (( $# >= 2 )) && [[ $2 == "--help" || $2 == "-h" ]] && group_exists "$1"; then
if (( $# >= 2 )) && [[ $2 == "--help" || $2 == "-h" || $2 == "?" ]] && group_exists "$1"; then
show_group_help "$1"
return 0
fi
Expand All @@ -1172,7 +1181,7 @@ main() {
fi

case "$1" in
--help | -h)
--help | -h | "?")
show_main_help
;;
logout | reboot | shutdown)
Expand Down