aboutsummaryrefslogtreecommitdiffstats
path: root/drmtest.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-12-19 12:55:23 +0100
committerGerd Hoffmann <kraxel@redhat.com>2019-12-19 12:55:23 +0100
commit7650fa92f37dc58a70a3bae70c96aec479119a22 (patch)
tree20aef6daaee56bed6d4f2227eb2337f4e306a8f0 /drmtest.c
parentb63a682193ba2965069e44b4f843c7c09c9c4986 (diff)
downloaddrminfo-7650fa92f37dc58a70a3bae70c96aec479119a22.tar.gz
drop some short options
Diffstat (limited to 'drmtest.c')
-rw-r--r--drmtest.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/drmtest.c b/drmtest.c
index bf7591a..200e5b5 100644
--- a/drmtest.c
+++ b/drmtest.c
@@ -344,8 +344,8 @@ static void usage(FILE *fp)
" -h | --help print this\n"
" -p | --pixman pixman mode\n"
" -a | --autotest autotest mode (don't print hardware info)\n"
- " -d | --dmabuf run dma-buf tests\n"
- " -v | --vgem vgem dma-buf import test\n"
+ " --dmabuf run dma-buf tests\n"
+ " --vgem vgem dma-buf import test\n"
" -c | --card <nr> pick card\n"
" -o | --output <name> pick output\n"
" -s | --sleep <secs> set sleep time (default: 60)\n"
@@ -353,10 +353,16 @@ static void usage(FILE *fp)
" -i | --image <file> load and display image <file>\n"
" -f | --format <fmt> pick framebuffer format\n"
" -m | --mode <mode> pick video mode format\n"
- " -L | --lease <output> get a drm lease for output\n"
+ " --lease <output> get a drm lease for output\n"
"\n");
}
+enum {
+ OPT_LONG_DMABUF = 0x100,
+ OPT_LONG_VGEM,
+ OPT_LONG_LEASE,
+};
+
struct option long_opts[] = {
{
/* --- no argument --- */
@@ -374,11 +380,11 @@ struct option long_opts[] = {
},{
.name = "dmabuf",
.has_arg = false,
- .val = 'd',
+ .val = OPT_LONG_DMABUF,
},{
.name = "vgem",
.has_arg = false,
- .val = 'v',
+ .val = OPT_LONG_VGEM,
},{
/* --- with argument --- */
@@ -412,7 +418,7 @@ struct option long_opts[] = {
},{
.name = "lease",
.has_arg = true,
- .val = 'L',
+ .val = OPT_LONG_LEASE,
},{
/* end of list */
}
@@ -435,11 +441,11 @@ int main(int argc, char **argv)
int c,i,pid,rc;
for (;;) {
- c = getopt_long(argc, argv, "hpdavu:L:c:s:o:i:f:m:", long_opts, NULL);
+ c = getopt_long(argc, argv, "hpau:c:s:o:i:f:m:", long_opts, NULL);
if (c == -1)
break;
switch (c) {
- case 'd':
+ case OPT_LONG_DMABUF:
dmabuf = true;
pixman = true;
break;
@@ -449,7 +455,7 @@ int main(int argc, char **argv)
case 'a':
autotest = true;
break;
- case 'v':
+ case OPT_LONG_VGEM:
vgem = true;
break;
case 'u':
@@ -473,7 +479,7 @@ int main(int argc, char **argv)
case 'm':
modename = optarg;
break;
- case 'L':
+ case OPT_LONG_LEASE:
lease_fd = drm_lease(optarg);
break;
case 'h':