diff options
-rw-r--r-- | fbinfo.c | 14 | ||||
-rw-r--r-- | fbtest.c | 14 | ||||
-rw-r--r-- | meson.build | 4 |
3 files changed, 28 insertions, 4 deletions
@@ -14,6 +14,7 @@ #include "fbtools.h" #include "logind.h" +#include "complete.h" /* ------------------------------------------------------------------ */ @@ -29,13 +30,21 @@ static void usage(FILE *fp) "\n"); } -struct option long_opts[] = { +enum { + OPT_LONG_COMP_BASH = 0x100, +}; + +static struct option long_opts[] = { { /* --- no argument --- */ .name = "help", .has_arg = false, .val = 'h', },{ + .name = "complete-bash", + .has_arg = false, + .val = OPT_LONG_COMP_BASH, + },{ /* --- with argument --- */ .name = "fbdev", @@ -59,6 +68,9 @@ int main(int argc, char **argv) case 'f': framebuffer = atoi(optarg); break; + case OPT_LONG_COMP_BASH: + complete_bash("fbinfo", long_opts); + exit(0); case 'h': usage(stdout); exit(0); @@ -18,6 +18,7 @@ #include "ttytools.h" #include "render.h" #include "image.h" +#include "complete.h" /* ------------------------------------------------------------------ */ @@ -72,7 +73,11 @@ static void usage(FILE *fp) "\n"); } -struct option long_opts[] = { +enum { + OPT_LONG_COMP_BASH = 0x100, +}; + +static struct option long_opts[] = { { /* --- no argument --- */ .name = "help", @@ -83,6 +88,10 @@ struct option long_opts[] = { .has_arg = false, .val = 'a', },{ + .name = "complete-bash", + .has_arg = false, + .val = OPT_LONG_COMP_BASH, + },{ /* --- with argument --- */ .name = "fbdev", @@ -125,6 +134,9 @@ int main(int argc, char **argv) case 'i': image = load_image(optarg); break; + case OPT_LONG_COMP_BASH: + complete_bash("fbinfo", long_opts); + exit(0); case 'h': usage(stdout); exit(0); diff --git a/meson.build b/meson.build index 66f819e..721962f 100644 --- a/meson.build +++ b/meson.build @@ -34,8 +34,8 @@ drminfo_srcs = [ 'drminfo.c', 'drmtools.c', 'drm-lease.c', 'drm-lease-x11.c', 'logind.c', 'complete.c' ] drmtest_srcs = [ 'drmtest.c', 'drmtools.c', 'drm-lease.c', 'drm-lease-x11.c', 'logind.c', 'complete.c', 'ttytools.c', 'render.c', 'image.c' ] -fbinfo_srcs = [ 'fbinfo.c', 'fbtools.c', 'logind.c' ] -fbtest_srcs = [ 'fbtest.c', 'fbtools.c', 'logind.c', +fbinfo_srcs = [ 'fbinfo.c', 'fbtools.c', 'logind.c', 'complete.c' ] +fbtest_srcs = [ 'fbtest.c', 'fbtools.c', 'logind.c', 'complete.c', 'ttytools.c', 'render.c', 'image.c' ] prime_srcs = [ 'prime.c', 'logind.c' ] viotest_srcs = [ 'virtiotest.c', 'drmtools.c', 'logind.c', 'ttytools.c', 'render.c' ] |