#!/bin/bash
#-----------------------------------------------------------------------------------------------------------------------------------
#
# Album MetaData Load Bash Completion 
#
# Copyright (C) 2016-2026 Arnaud G. GIBERT
# mailto:arnaud@rx3.net
#
# This is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; If not, see
# <https://www.gnu.org/licenses/>.
#
#-----------------------------------------------------------------------------------------------------------------------------------



#-----------------------------------------------------------------------------------------------------------------------------------
# Album MetaData Load Completion
#-----------------------------------------------------------------------------------------------------------------------------------

_album_metadata_load_completion()
{
    local cur prev words cword
    _init_completion || return

    local options="
        -h --help
        -V --version
        -T --test
        -v --verbose
        -c --clean
    "

    if (( cword == 1 )) && [[ "${cur}" == -* ]]; then
        COMPREPLY=( $(compgen -W "${options}" -- "${cur}") )
        return
    fi

    case "${prev}" in
        --help|-h|--version|-V|--test|-T|--verbose|-v|--clean|-c)
            COMPREPLY=()
        ;;
        
        *)
            if (( cword >= 1 )) && (( cword <= 3 )); then
                case "${cword}" in
                    1)
                        # source_dir
                        _filedir -d
                    ;;

                    2)
                        # target_dir
                        _filedir -d
                    ;;

                    3)
                        # metadata_file
                        _filedir
                    ;;
                esac
            fi
        ;;
    esac
}



complete -F _album_metadata_load_completion album_metadata_load
