aboutsummaryrefslogtreecommitdiffstats
path: root/prime.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2020-01-02 13:56:27 +0100
committerGerd Hoffmann <kraxel@redhat.com>2020-01-02 13:56:27 +0100
commit3ee2b3777bee7604037a85761f6fc2c55e902f0d (patch)
tree4563b1e91a758c950960901efd1b577d6fd6b73a /prime.c
parent3032bb0fd50418060f91a598d5ec1abc1b7f3efc (diff)
downloaddrminfo-3ee2b3777bee7604037a85761f6fc2c55e902f0d.tar.gz
bash completion: rest
Diffstat (limited to 'prime.c')
-rw-r--r--prime.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/prime.c b/prime.c
index f0d6566..b63b1f0 100644
--- a/prime.c
+++ b/prime.c
@@ -17,6 +17,7 @@
#include <gbm.h>
#include "logind.h"
+#include "complete.h"
#define TEST_WIDTH 640
#define TEST_HEIGHT 480
@@ -245,7 +246,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",
@@ -256,6 +261,10 @@ struct option long_opts[] = {
.has_arg = false,
.val = 'l',
},{
+ .name = "complete-bash",
+ .has_arg = false,
+ .val = OPT_LONG_COMP_BASH,
+ },{
/* end of list */
}
};
@@ -274,6 +283,9 @@ int main(int argc, char **argv)
case 'l':
list = true;
break;
+ case OPT_LONG_COMP_BASH:
+ complete_bash("prime", long_opts);
+ exit(0);
case 'h':
usage(stdout);
exit(0);