function __fish_kdb_no_subcommand \
-d 'Check if the current commandline buffer does not contain a subcommand'
    set subcommands (__fish_kdb_complete)
    for input in (commandline -opc)
        if contains -- $input $subcommands
            return 1
        end
    end
    return 0
end

function __fish_kdb_complete -d 'Print a list of kdb subcommands'
    kdb list-commands $argv | awk '{if(NR>1)print}'
end

complete -c kdb -n '__fish_kdb_no_subcommand' -x -a '(__fish_kdb_complete -v)'

function __fish_kdb_no_subcommand \
-d 'Check if the current commandline buffer does not contain a subcommand'
    set subcommands (__fish_kdb_print_subcommands)
    for input in (commandline -opc)
        if contains -- $input $subcommands
            return 1
        end
    end
    return 0
end

function __fish_kdb_print_subcommands -d 'Print a list of kdb subcommands'
    kdb list-commands $argv | awk '{if(NR>1)print}'
end

complete -c kdb -n '__fish_kdb_no_subcommand' -x \
    -a  '(__fish_kdb_print_subcommands -v)'

Use more descriptive function name
Completions: Use more descriptive function name

e1528532/libelektra,e1528532/libelektra,ElektraInitiative/libelektra,e1528532/libelektra,mpranj/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,mpranj/libelektra,petermax2/libelektra,mpranj/libelektra,petermax2/libelektra,BernhardDenner/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,e1528532/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,mpranj/libelektra,e1528532/libelektra,mpranj/libelektra,mpranj/libelektra,e1528532/libelektra,petermax2/libelektra,petermax2/libelektra,e1528532/libelektra,petermax2/libelektra,mpranj/libelektra,petermax2/libelektra,BernhardDenner/libelektra,mpranj/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra,mpranj/libelektra,ElektraInitiative/libelektra,e1528532/libelektra,BernhardDenner/libelektra,BernhardDenner/libelektra