diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2020-01-02 13:56:27 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-01-02 13:56:27 +0100 |
commit | 3ee2b3777bee7604037a85761f6fc2c55e902f0d (patch) | |
tree | 4563b1e91a758c950960901efd1b577d6fd6b73a /gtktest.c | |
parent | 3032bb0fd50418060f91a598d5ec1abc1b7f3efc (diff) | |
download | drminfo-3ee2b3777bee7604037a85761f6fc2c55e902f0d.tar.gz |
bash completion: rest
Diffstat (limited to 'gtktest.c')
-rw-r--r-- | gtktest.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -8,6 +8,7 @@ #include "render.h" #include "image.h" +#include "complete.h" cairo_surface_t *image; @@ -42,13 +43,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 = "image", @@ -76,6 +85,9 @@ int main(int argc, char *argv[]) case 'i': ifile = optarg; break; + case OPT_LONG_COMP_BASH: + complete_bash("gtktest", long_opts); + exit(0); case 'h': usage(stdout); exit(0); |