aboutsummaryrefslogtreecommitdiffstats
path: root/qpdf
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2020-03-31 17:38:05 +0200
committerJay Berkenbilt <ejb@ql.org>2020-03-31 23:39:20 +0200
commitb03e6bd65d2144ec3b200c04514bc95cabfc085f (patch)
tree7dd0db7c2bc2462a172edd6e4f96e157dd56a545 /qpdf
parentbb6768b8f0e3b676b3e82e7f46475df5ad1855b8 (diff)
downloadqpdf-b03e6bd65d2144ec3b200c04514bc95cabfc085f.tar.zst
Use QPDF_EXECUTABLE as a hint for completion
Diffstat (limited to 'qpdf')
-rw-r--r--qpdf/qpdf.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/qpdf/qpdf.cc b/qpdf/qpdf.cc
index 1f09bb45..de4a0297 100644
--- a/qpdf/qpdf.cc
+++ b/qpdf/qpdf.cc
@@ -1599,12 +1599,17 @@ void
ArgParser::argCompletionBash()
{
std::string progname = argv[0];
- // Detect if we're in an AppImage and adjust
+ std::string executable;
std::string appdir;
std::string appimage;
- if (QUtil::get_env("APPDIR", &appdir) &&
- QUtil::get_env("APPIMAGE", &appimage))
+ if (QUtil::get_env("QPDF_EXECUTABLE", &executable))
{
+ progname = executable;
+ }
+ else if (QUtil::get_env("APPDIR", &appdir) &&
+ QUtil::get_env("APPIMAGE", &appimage))
+ {
+ // Detect if we're in an AppImage and adjust
if ((appdir.length() < strlen(argv[0])) &&
(strncmp(appdir.c_str(), argv[0], appdir.length()) == 0))
{