Add -pt argument for setting pretext

This commit is contained in:
speedie 2023-07-24 16:38:41 +02:00
parent 7d1b58f431
commit 3f5c0b657b
3 changed files with 9 additions and 0 deletions

View file

@ -106,6 +106,9 @@ in the config files.
`-p, --prompt text`
: Set spmenu prompt text to text
`-pt, --pretext text`
: Set spmenu pretext to text
`-It, --input text`
: Set initial input text to text

View file

@ -352,6 +352,8 @@ void readargs(int argc, char *argv[]) {
menuwidth = atoi(argv[++i]);
else if (!strcmp(argv[i], "-p") || (!strcmp(argv[i], "--prompt"))) // adds prompt to left of input field
prompt = argv[++i];
else if (!strcmp(argv[i], "-pt") || (!strcmp(argv[i], "--pretext"))) // adds pretext
pretext = argv[++i];
else if (!strcmp(argv[i], "-It") || (!strcmp(argv[i], "--input"))) // specify initial text
input = argv[++i];
else if (!strcmp(argv[i], "-fn") || (!strcmp(argv[i], "--font"))) // font or font set
@ -623,6 +625,7 @@ void usage(int status) {
"spmenu -P, --password Hide characters\n"
"spmenu -nP, --no-password Don't hide characters\n"
"spmenu -p, --prompt <text> Set spmenu prompt text to <text>\n"
"spmenu -pt, --pretext <text> Set spmenu pretext to <text>\n"
"spmenu -It, --input <text> Set initial input text to <text>\n"
"spmenu -ip, --indent Indent items to prompt width\n"
"spmenu -nip, --no-indent Don't indent items to prompt width\n"

View file

@ -133,6 +133,9 @@ Don\[cq]t hide characters
\f[V]-p, --prompt text\f[R]
Set spmenu prompt text to text
.TP
\f[V]-pt, --pretext text\f[R]
Set spmenu pretext to text
.TP
\f[V]-It, --input text\f[R]
Set initial input text to text
.TP