last commit can now be done with an argument

This commit is contained in:
speedie 2023-04-20 19:19:46 +02:00
parent a2c28dbfdd
commit b58eb6cb9f
3 changed files with 18 additions and 0 deletions

View file

@ -89,6 +89,12 @@ You may use long, descriptive arguments or the shorter arguments.
`-nci, --no-color-items`
: Don't color items
`-sgr, --sgr`
: Interpret SGR sequences
`-nsgr, --no-sgr`
: Display SGR sequences as text
`-a, --alpha`
: Enable alpha

View file

@ -165,6 +165,10 @@ readargs(int argc, char *argv[])
coloritems = 1;
} else if (!strcmp(argv[i], "-nci") || (!strcmp(argv[i], "--no-color-items"))) { // don't color items
coloritems = 0;
} else if (!strcmp(argv[i], "-sgr") || (!strcmp(argv[i], "--sgr"))) { // enable sgr seq support
sgr = 1;
} else if (!strcmp(argv[i], "-nsgr") || (!strcmp(argv[i], "--no-sgr"))) { // disable sgr seq support
sgr = 0;
} else if (i + 1 == argc) {
// any of the arguments we checked first
if ((!strcmp(argv[i], "-xrdb")
@ -426,6 +430,8 @@ usage(void)
"spmenu -nip, --no-indent Don't indent items to prompt width\n"
"spmenu -ci, --color-items Color items\n"
"spmenu -nci, --no-color-items Don't color items\n"
"spmenu -sgr, --sgr Interpret SGR sequences\n"
"spmenu -nsgr, --no-sgr Display SGR sequences as text\n"
"spmenu -a, --alpha Enable alpha\n"
"spmenu -na, --no-alpha Disable alpha\n"
"spmenu -tp, --allow-typing Allow the user to type\n"

View file

@ -106,6 +106,12 @@ Color items
\f[V]-nci, --no-color-items\f[R]
Don\[cq]t color items
.TP
\f[V]-sgr, --sgr\f[R]
Interpret SGR sequences
.TP
\f[V]-nsgr, --no-sgr\f[R]
Display SGR sequences as text
.TP
\f[V]-a, --alpha\f[R]
Enable alpha
.TP