_stne_color() {
	local i comps cmd
	local cur prev
	_get_comp_words_by_ref cur prev

	local -A flags=(
		[-h]=1
		[--help]=1
		[--version]=1
	)

	local -A options=(
	)

	local -A commands=(
		[nightlight-inhibit]=1
		[nightlight-toggle]=1
		[reload]=1
		[status]=1
		[update-location]=1
	)

	if [[ ${options[$prev]} ]]; then
		case $prev in

		esac

		COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
		return 0
	fi

	if [[ "$cur" = -* ]]; then
		comps=( ${!flags[@]} ${!options[@]} )
		COMPREPLY=( $(compgen -W '${comps[@]}' -- "$cur") )
		return 0
	fi

	for i in "${!COMP_WORDS[@]}"; do
		local word="${COMP_WORDS[i]}"
		if [[ -z $word ]]; then
			continue
		fi

		if [[ ${commands[$word]} && !${options[COMP_WORDS[i-1]]} ]]; then
			cmd=${COMP_WORDS[i]}
			break
		fi
	done

	n=$(($COMP_CWORD - $i))

	if [[ -z $cmd || $n == 0 ]]; then
		comps=( ${!commands[@]} )
	fi

	COMPREPLY=( $(compgen -W '${comps[@]}' -- "$cur") )
	return 0
}

complete -F _stne_color stne-color
