diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2020-01-02 13:40:02 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-01-02 13:40:02 +0100 |
commit | 15c9e8790cf5d7f1feff9ac0d7326ba4b889f123 (patch) | |
tree | 337c54fd3fdaf49a97e6dc69fb23e17546857cbf | |
parent | 7303df70a900bef271044b7eaef35fcb3416a40f (diff) | |
download | drminfo-15c9e8790cf5d7f1feff9ac0d7326ba4b889f123.tar.gz |
more bash completion & fixes
-rw-r--r-- | drminfo.c | 2 | ||||
-rw-r--r-- | drmtest.c | 4 | ||||
-rw-r--r-- | egltest.c | 13 | ||||
-rw-r--r-- | meson.build | 2 |
4 files changed, 15 insertions, 6 deletions
@@ -464,7 +464,7 @@ enum { OPT_LONG_COMP_BASH, }; -struct option long_opts[] = { +static struct option long_opts[] = { { /* --- no argument --- */ .name = "help", @@ -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); @@ -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, |