__app="setup-gia-9"

_mycommand() {
    local cur prev opts
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"

    opts="
    install-gia-programs
    uninstall-gia-programs
    create-gia-shortcuts
    remove-other-from-desktop
    remove-gia-shortcuts
    restore-desktop
    disable-updates
    enable-updates
    disable-wifi
    enable-wifi
    disable-network
    enable-network
    restrict-network-change
    allow-network-change
    disable-sounds
    enable-sounds
    disable-mos-identify
    enable-mos-identify
    disable-power-management
    enable-power-management
    disable-mos-appstore
    enable-mos-appstore
    setup-all-for-gia
    remove-all-setup
    disable-network-for-while
    reset-timers
    show-timers
    help
    "

    # Специальная обработка для команды disable-network-for-while
    if [[ ${COMP_CWORD} -eq 2 ]] && [[ "${COMP_WORDS[1]}" == "disable-network-for-while" ]]; then
        # Текущая дата + 1 час как подсказка
        local default_time=$(date -d '+1 hour' '+%Y-%m-%d-%H-%M' 2>/dev/null || echo "YYYY-MM-DD-HH-MM")
        COMPREPLY=( $(compgen -W "${default_time}" -- ${cur}) )
        return 0
    fi

    if [[ ${cur} == * ]]; then
        COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
        return 0
    fi
}

complete -F _mycommand ${__app}