From 6cd7b5b05ee32be426d7e010b0c56603d0e228c8 Mon Sep 17 00:00:00 2001 From: Jack Jamison Date: Sat, 18 Oct 2025 13:16:02 -0400 Subject: center option --- args.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'args.c') diff --git a/args.c b/args.c index 5fbc381..1967a24 100644 --- a/args.c +++ b/args.c @@ -8,17 +8,21 @@ void parse_args(client_state* state, int argc, char* argv[]) { static struct option long_opts[] = { {"lines", required_argument, 0, 'l'}, - {"allow-free-result", required_argument, 0, 'a'}, + {"center", no_argument, 0, 'c'}, + {"allow-free-result", no_argument, 0, 'a'}, {0, 0, 0, 0} }; int opt; int long_index = 0; - while ((opt = getopt_long(argc, argv, "l:a", long_opts, &long_index)) != -1) { + while ((opt = getopt_long(argc, argv, "l:ca", long_opts, &long_index)) != -1) { switch (opt) { case 'l': state->lines = atoi(optarg); break; + case 'c': + state->center = true; + break; case 'a': state->allow_free_result = true; break; -- cgit v1.2.3