help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Workaround to replace 'complete -D' in bash 3.2


From: Vitaly Potyarkin
Subject: Workaround to replace 'complete -D' in bash 3.2
Date: Mon, 16 Dec 2019 17:44:51 +0300

I'm trying enable bash 3.2 support in my custom completion script.

It replaces default filepath completion behavior, therefore custom
completion function needs to be enabled for all commands that do not
already have some compspec defined.

Modern bash versions provide an easy way to do it - the `-D` flag of
`complete` builtin, but bash 3.2 did not support that feature yet.
Was there any workaround back then? May be some dynamic loading trick?
Or did users just have to define all possible compspecs beforehand at
launch time?

Google was not of much help - after all I am looking for a workaround
to a problem that's been fixed for eight years. I've also looked at
scop/bash-completion - but have not found any insights. It seems they've
used a helper `have()` function to load relevant completion scripts
which in turn provided hardcoded compspecs. Bash documentation from that
era does not seem to mention my usecase, but it's so vast I may have
overlooked the correct section.

Any ideas are greatly appreciated! Thank you!

PS: If anyone is interested, this is the pull request I'm working on:
<https://github.com/sio/bash-complete-partial-path/pull/18>

--
Vitaly



reply via email to

[Prev in Thread] Current Thread [Next in Thread]