- Add music_tools lib,

- Migrate album_metadata_load .
This commit is contained in:
2026-04-11 23:52:08 +02:00
parent 7abfcab917
commit 6f09c6c806
7 changed files with 833 additions and 85 deletions

View File

@@ -1,7 +1,7 @@
#!/bin/bash
#-----------------------------------------------------------------------------------------------------------------------------------
#
# Album Convert
# Album Convert Bash Completion
#
# Copyright (C) 2016-2026 Arnaud G. GIBERT
# mailto:arnaud@rx3.net
@@ -25,7 +25,8 @@
_album_convert_completion() {
_album_convert_completion()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"

View File

@@ -1,7 +1,7 @@
#!/bin/bash
#-----------------------------------------------------------------------------------------------------------------------------------
#
# Album Merge
# Album Merge Bash Completion
#
# Copyright (C) 2016-2026 Arnaud G. GIBERT
# mailto:arnaud@rx3.net
@@ -25,7 +25,8 @@
_album_merge_completion() {
_album_merge_completion()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
@@ -41,10 +42,11 @@ _album_merge_completion() {
case ${COMP_CWORD} in
1|2)
COMPREPLY=( $(compgen -d -- "${cur}") )
;;
;;
3|4)
COMPREPLY=()
;;
;;
esac
}

View File

@@ -0,0 +1,76 @@
#!/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/>.
#
#-----------------------------------------------------------------------------------------------------------------------------------
# -*- mode: shell; sh-basic-offset: 4; indent-tabs-mode: nil; -*-
_album_metadata_load()
{
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 album_metadata_load

View File

@@ -1,7 +1,7 @@
#!/bin/bash
#-----------------------------------------------------------------------------------------------------------------------------------
#
# Album Name Fix
# Album Name Fix Bash Completion
#
# Copyright (C) 2016-2026 Arnaud G. GIBERT
# mailto:arnaud@rx3.net
@@ -41,13 +41,15 @@ _album_name_fix_completion() {
case "${prev}" in
-a|--album_dir)
COMPREPLY=( $(compgen -d -- "${cur}") )
;;
;;
-p|--music_pattern)
COMPREPLY=()
;;
;;
-s|--sed_substitute_pattern)
COMPREPLY=()
;;
;;
esac
}