aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2020-01-02 13:40:02 +0100
committerGerd Hoffmann <kraxel@redhat.com>2020-01-02 13:40:02 +0100
commit15c9e8790cf5d7f1feff9ac0d7326ba4b889f123 (patch)
tree337c54fd3fdaf49a97e6dc69fb23e17546857cbf
parent7303df70a900bef271044b7eaef35fcb3416a40f (diff)
downloaddrminfo-15c9e8790cf5d7f1feff9ac0d7326ba4b889f123.tar.gz
more bash completion & fixes
-rw-r--r--drminfo.c2
-rw-r--r--drmtest.c4
-rw-r--r--egltest.c13
-rw-r--r--meson.build2
4 files changed, 15 insertions, 6 deletions
diff --git a/drminfo.c b/drminfo.c
index e806417..ebadb80 100644
--- a/drminfo.c
+++ b/drminfo.c
@@ -464,7 +464,7 @@ enum {
OPT_LONG_COMP_BASH,
};
-struct option long_opts[] = {
+static struct option long_opts[] = {
{
/* --- no argument --- */
.name = "help",
diff --git a/drmtest.c b/drmtest.c
index 26450ca..a5fd5d8 100644
--- a/drmtest.c
+++ b/drmtest.c
@@ -395,7 +395,7 @@ enum {
OPT_LONG_COMP_BASH,
};
-struct option long_opts[] = {
+static struct option long_opts[] = {
{
/* --- no argument --- */
.name = "help",
@@ -527,7 +527,7 @@ int main(int argc, char **argv)
lease_fd = drm_lease(optarg);
break;
case OPT_LONG_COMP_BASH:
- complete_bash("drminfo", long_opts);
+ complete_bash("drmtest", long_opts);
exit(0);
case 'h':
usage(stdout);
diff --git a/egltest.c b/egltest.c
index 2a13dc2..6a82d6b 100644
--- a/egltest.c
+++ b/egltest.c
@@ -22,6 +22,7 @@
#include "drm-lease.h"
#include "logind.h"
#include "ttytools.h"
+#include "complete.h"
/* ------------------------------------------------------------------ */
@@ -86,9 +87,10 @@ static void usage(FILE *fp)
enum {
OPT_LONG_LEASE,
+ OPT_LONG_COMP_BASH,
};
-struct option long_opts[] = {
+static struct option long_opts[] = {
{
/* --- no argument --- */
.name = "help",
@@ -107,6 +109,10 @@ struct option long_opts[] = {
.has_arg = false,
.val = 'x',
},{
+ .name = "complete-bash",
+ .has_arg = false,
+ .val = OPT_LONG_COMP_BASH,
+ },{
/* --- with argument --- */
.name = "card",
@@ -157,9 +163,12 @@ int main(int argc, char **argv)
case 'a':
autotest = true;
break;
- case 'L':
+ case OPT_LONG_LEASE:
lease_fd = drm_lease(optarg);
break;
+ case OPT_LONG_COMP_BASH:
+ complete_bash("egltest", long_opts);
+ exit(0);
case 'h':
usage(stdout);
exit(0);
diff --git a/meson.build b/meson.build
index 63ccd7c..66f819e 100644
--- a/meson.build
+++ b/meson.build
@@ -41,7 +41,7 @@ prime_srcs = [ 'prime.c', 'logind.c' ]
viotest_srcs = [ 'virtiotest.c', 'drmtools.c', 'logind.c', 'ttytools.c', 'render.c' ]
egltest_srcs = [ 'egltest.c', 'drmtools.c', 'drmtools-egl.c',
'drm-lease.c', 'drm-lease-x11.c',
- 'logind.c', 'ttytools.c' ]
+ 'logind.c', 'complete.c', 'ttytools.c' ]
gtktest_srcs = [ 'gtktest.c', 'render.c', 'image.c' ]
drminfo_deps = [ libdrm_dep, cairo_dep, pixman_dep, systemd_dep,