There are two system directories for bash-completion scripts. One is /usr/share/bash-completion/completions/ and the other is /etc/bash_completion.d/. The "etc" scripts are loaded in advance and for backward compatibility while the "usr" scripts are loaded on demand. To load scripts on demand it requires a corresponding script for every command. So, the main bash-completion script is split into several subscripts for different "grub-*" commands. To share the code the real completion functions are still implemented in "grub" and each subscript sources "grub" and invokes the corresponding function. Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
31 lines
1000 B
Bash
31 lines
1000 B
Bash
#
|
|
# Bash completion for @grub-editenv@
|
|
#
|
|
# Copyright (C) 2024 Free Software Foundation, Inc.
|
|
#
|
|
# GRUB is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
_grub_editenv () {
|
|
. @datarootdir@/bash-completion/completions/grub && __grub_editenv
|
|
}
|
|
complete -F _grub_editenv -o filenames @grub_editenv@
|
|
|
|
# Local variables:
|
|
# mode: shell-script
|
|
# sh-basic-offset: 4
|
|
# sh-indent-comment: t
|
|
# indent-tabs-mode: nil
|
|
# End:
|
|
# ex: ts=4 sw=4 et filetype=sh
|