Use "Fl Fl" for long options.
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
This commit is contained in:

committed by
Love Hornquist Astrand

parent
05a432aaed
commit
db8e287e41
@@ -246,20 +246,20 @@ or
|
||||
.Pp
|
||||
Long option names are prefixed with -- (double dash), and the value
|
||||
with a = (equal),
|
||||
.Fl -foo= Ns Ar bar .
|
||||
.Fl Fl foo= Ns Ar bar .
|
||||
Long option flags can either be specified as they are
|
||||
.Pf ( Fl -help ) ,
|
||||
.Pf ( Fl Fl help ) ,
|
||||
or with an (boolean parsable) option
|
||||
.Pf ( Fl -help= Ns Ar yes ,
|
||||
.Fl -help= Ns Ar true ,
|
||||
.Pf ( Fl Fl help= Ns Ar yes ,
|
||||
.Fl Fl help= Ns Ar true ,
|
||||
or similar), or they can also be negated
|
||||
.Pf ( Fl -no-help
|
||||
.Pf ( Fl Fl no-help
|
||||
is the same as
|
||||
.Fl -help= Ns no ) ,
|
||||
.Fl Fl help= Ns no ) ,
|
||||
and if you're really confused you can do it multiple times
|
||||
.Pf ( Fl -no-no-help= Ns Ar false ,
|
||||
.Pf ( Fl Fl no-no-help= Ns Ar false ,
|
||||
or even
|
||||
.Fl -no-no-help= Ns Ar maybe ) .
|
||||
.Fl Fl no-no-help= Ns Ar maybe ) .
|
||||
.Sh EXAMPLE
|
||||
.Bd -literal
|
||||
#include <stdio.h>
|
||||
|
@@ -133,7 +133,7 @@ mandoc_template(struct getargs *args,
|
||||
}
|
||||
if(args[i].long_name) {
|
||||
print_arg(buf, sizeof(buf), 1, 1, args + i, i18n);
|
||||
printf("Fl -%s%s%s",
|
||||
printf("Fl Fl %s%s%s",
|
||||
args[i].type == arg_negative_flag ? "no-" : "",
|
||||
args[i].long_name, buf);
|
||||
}
|
||||
@@ -142,7 +142,7 @@ mandoc_template(struct getargs *args,
|
||||
print_arg(buf, sizeof(buf), 1, 0, args + i, i18n);
|
||||
printf(".Oo Fl %c%s \\*(Ba Xo\n", args[i].short_name, buf);
|
||||
print_arg(buf, sizeof(buf), 1, 1, args + i, i18n);
|
||||
printf(".Fl -%s%s\n.Xc\n.Oc\n", args[i].long_name, buf);
|
||||
printf(".Fl Fl %s%s\n.Xc\n.Oc\n", args[i].long_name, buf);
|
||||
}
|
||||
/*
|
||||
if(args[i].type == arg_strings)
|
||||
@@ -165,7 +165,7 @@ mandoc_template(struct getargs *args,
|
||||
printf("\n");
|
||||
}
|
||||
if(args[i].long_name){
|
||||
printf(".Fl -%s%s",
|
||||
printf(".Fl Fl %s%s",
|
||||
args[i].type == arg_negative_flag ? "no-" : "",
|
||||
args[i].long_name);
|
||||
print_arg(buf, sizeof(buf), 1, 1, args + i, i18n);
|
||||
|
Reference in New Issue
Block a user