Fix Bash completion for dirs when not using actual dir
This commit is contained in:
parent
03fdc62dce
commit
43d2d280e1
|
@ -113,7 +113,7 @@ set(META_APP_DESCRIPTION "Useful C++ classes and routines such as argument parse
|
|||
set(META_FEATURES_FOR_COMPILER_DETECTION_HEADER cxx_thread_local)
|
||||
set(META_VERSION_MAJOR 5)
|
||||
set(META_VERSION_MINOR 0)
|
||||
set(META_VERSION_PATCH 0)
|
||||
set(META_VERSION_PATCH 1)
|
||||
|
||||
# find required 3rd party libraries
|
||||
include(3rdParty)
|
||||
|
|
|
@ -1521,16 +1521,21 @@ void ArgumentParser::printBashCompletion(int argc, const char *const *argv, unsi
|
|||
continue;
|
||||
}
|
||||
auto dirEntryName = dirEntry.path().filename().string();
|
||||
auto hasStartingQuote = false;
|
||||
if (useActualDir) {
|
||||
if (!startsWith(dirEntryName, actualFile)) {
|
||||
continue;
|
||||
}
|
||||
cout << '\'';
|
||||
hasStartingQuote = true;
|
||||
if (actualDir != ".") {
|
||||
cout << actualDir;
|
||||
}
|
||||
}
|
||||
findAndReplace(dirEntryName, replace, with);
|
||||
if (!hasStartingQuote) {
|
||||
cout << '\'';
|
||||
}
|
||||
cout << dirEntryName << '\'' << ' ';
|
||||
haveFileOrDirCompletions = true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue