summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorZachIR <zachir@librem.one>2025-07-17 15:04:24 -0500
committerZachIR <zachir@librem.one>2025-07-17 15:04:24 -0500
commit384ae5ab297bfae189532b4290179daeb3e89fad (patch)
tree5790a6c707d55200c64fd17c751eb8e5135564a2 /src/main.c
parent3e8a012e4191bbe4da394049fef6e5df3ad9ef6f (diff)
Add -P password flag
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 1bb0982..74a26d7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -829,6 +829,7 @@ static void usage(bool err)
" -h, --help Print this message and exit.\n"
" -c, --config <path> Specify a config file.\n"
" -b, --bottom Anchor to the bottom of the screen.\n"
+" -P, --password Hide the input text.\n"
" --prompt-text <string> Prompt text.\n"
" --width <px|%> Width of the window.\n"
" --height <px|%> Height of the window.\n"
@@ -844,6 +845,7 @@ static void usage(bool err)
const struct option long_options[] = {
{"help", no_argument, NULL, 'h'},
{"bottom", no_argument, NULL, 'b'},
+ {"password", no_argument, NULL, 'P'},
{"config", required_argument, NULL, 'c'},
{"include", required_argument, NULL, 0},
{"anchor", required_argument, NULL, 0},
@@ -931,7 +933,7 @@ const struct option long_options[] = {
{"late-keyboard-init", optional_argument, NULL, 'k'},
{NULL, 0, NULL, 0}
};
-const char *short_options = ":bhc:";
+const char *short_options = ":bhPc:";
static void parse_args(struct tofi *tofi, int argc, char *argv[])
{
@@ -983,6 +985,10 @@ static void parse_args(struct tofi *tofi, int argc, char *argv[])
if (!config_apply(tofi, "bottom", optarg)) {
exit(EXIT_FAILURE);
}
+ } else if (opt == 'P') {
+ if (!config_apply(tofi, "password", optarg)) {
+ exit(EXIT_FAILURE);
+ }
} else if (opt == 'k') {
/*
* Backwards compatibility for --late-keyboard-init not