| 1 |
# SPDX-License-Identifier: GPL-3.0-or-later |
| 2 |
# Copyright (C) 2025-2026 Benjamin Abendroth <[email protected]> |
| 3 |
|
| 4 |
'''Version-dependent Bash code.''' |
| 5 |
|
| 6 |
|
| 7 |
# pylint: disable=missing-function-docstring |
| 8 |
|
| 9 |
|
| 10 |
def filedir(ctxt): |
| 11 |
if ctxt.config.bash_completions_version >= (2, 12): |
| 12 |
return '_comp_compgen_filedir' |
| 13 |
|
| 14 |
return '_filedir' |
| 15 |
|
| 16 |
|
| 17 |
def init_completion(ctxt): |
| 18 |
if ctxt.config.bash_completions_version >= (2, 12): |
| 19 |
return '_comp_initialize' |
| 20 |
|
| 21 |
return '_init_completion' |
| 22 |
|
| 23 |
|
| 24 |
def completion_loader(ctxt): |
| 25 |
if ctxt.config.bash_completions_version >= (2, 12): |
| 26 |
return '_comp_complete_load' |
| 27 |
|
| 28 |
return '_completion_loader' |
| 29 |
|
| 30 |
|
| 31 |
def pids(ctxt): |
| 32 |
if ctxt.config.bash_completions_version >= (2, 12): |
| 33 |
return '_comp_compgen_pids' |
| 34 |
|
| 35 |
return '_pids' |
| 36 |
|
| 37 |
|
| 38 |
def pnames(ctxt): |
| 39 |
if ctxt.config.bash_completions_version >= (2, 12): |
| 40 |
return '_comp_compgen_pnames' |
| 41 |
|
| 42 |
return '_pnames' |
| 43 |
|
| 44 |
|
| 45 |
def uids(ctxt): |
| 46 |
if ctxt.config.bash_completions_version >= (2, 12): |
| 47 |
return '_comp_compgen_uids' |
| 48 |
|
| 49 |
return '_uids' |
| 50 |
|
| 51 |
|
| 52 |
def gids(ctxt): |
| 53 |
if ctxt.config.bash_completions_version >= (2, 12): |
| 54 |
return '_comp_compgen_gids' |
| 55 |
|
| 56 |
return '_gids' |
| 57 |
|
| 58 |
|
| 59 |
def shells(ctxt): |
| 60 |
if ctxt.config.bash_completions_version >= (2, 12): |
| 61 |
return '_comp_compgen -a shells' |
| 62 |
|
| 63 |
return '_shells' |
| 64 |
|
| 65 |
|
| 66 |
def signals(ctxt): |
| 67 |
if ctxt.config.bash_completions_version >= (2, 12): |
| 68 |
return '_comp_compgen_signals' |
| 69 |
|
| 70 |
return '_signals' |
| 71 |
|
| 72 |
|
| 73 |
def fstypes(ctxt): |
| 74 |
if ctxt.config.bash_completions_version >= (2, 12): |
| 75 |
return '_comp_compgen -a fstypes' |
| 76 |
|
| 77 |
return '_fstypes' |
| 78 |
|
| 79 |
|
| 80 |
def command_offset(ctxt): |
| 81 |
if ctxt.config.bash_completions_version >= (2, 12): |
| 82 |
return '_comp_command_offset' |
| 83 |
|
| 84 |
return '_command_offset' |
| 85 |
|
| 86 |
|
| 87 |
def available_interfaces(ctxt): |
| 88 |
if ctxt.config.bash_completions_version >= (2, 12): |
| 89 |
return '_comp_compgen_available_interfaces' |
| 90 |
|
| 91 |
return '_available_interfaces' |
| 92 |
|
| 93 |
|
| 94 |
def ip_addresses(ctxt): |
| 95 |
if ctxt.config.bash_completions_version >= (2, 12): |
| 96 |
return '_comp_compgen_ip_addresses' |
| 97 |
|
| 98 |
return '_ip_addresses' |