aboutsummaryrefslogtreecommitdiffstats
path: root/fbinfo.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2020-01-02 13:46:38 +0100
committerGerd Hoffmann <kraxel@redhat.com>2020-01-02 13:46:38 +0100
commit3032bb0fd50418060f91a598d5ec1abc1b7f3efc (patch)
tree19471e94392f107d82a65a9171fbd60f6accc343 /fbinfo.c
parent15c9e8790cf5d7f1feff9ac0d7326ba4b889f123 (diff)
downloaddrminfo-3032bb0fd50418060f91a598d5ec1abc1b7f3efc.tar.gz
bash completion: fb tools
Diffstat (limited to 'fbinfo.c')
-rw-r--r--fbinfo.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/fbinfo.c b/fbinfo.c
index dceca01..e3f3bf7 100644
--- a/fbinfo.c
+++ b/fbinfo.c
@@ -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);