diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2020-01-02 13:46:38 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-01-02 13:46:38 +0100 |
commit | 3032bb0fd50418060f91a598d5ec1abc1b7f3efc (patch) | |
tree | 19471e94392f107d82a65a9171fbd60f6accc343 /fbtest.c | |
parent | 15c9e8790cf5d7f1feff9ac0d7326ba4b889f123 (diff) | |
download | drminfo-3032bb0fd50418060f91a598d5ec1abc1b7f3efc.tar.gz |
bash completion: fb tools
Diffstat (limited to 'fbtest.c')
-rw-r--r-- | fbtest.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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); |