From e26c81fe9ab43ef0148f51464dbae0f7a0e2b91e Mon Sep 17 00:00:00 2001 From: N-R-K <79544946+N-R-K@users.noreply.github.com> Date: Wed, 23 Feb 2022 09:23:22 +0000 Subject: use win-title script for customizing window title (#213) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this removes the cli flag `-T` as well as related config.h options. Co-authored-by: Berke Kocaoğlu --- options.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'options.c') diff --git a/options.c b/options.c index 361ed88..96cf092 100644 --- a/options.c +++ b/options.c @@ -18,8 +18,6 @@ */ #include "nsxiv.h" -#define _TITLE_CONFIG -#include "config.h" #include "version.h" #include @@ -31,10 +29,23 @@ const opt_t *options; void print_usage(void) { printf("usage: nsxiv [-abcfhiopqrtvZ0] [-A FRAMERATE] [-e WID] [-G GAMMA] " - "[-g GEOMETRY] [-N NAME] [-T TITLE] [-n NUM] [-S DELAY] [-s MODE] " + "[-g GEOMETRY] [-N NAME] [-n NUM] [-S DELAY] [-s MODE] " "[-z ZOOM] FILES...\n"); } +static void title_deprecation_notice(void) +{ + error(EXIT_FAILURE, 0, "\n" + "################################################################\n" + "# DEPRECATION NOTICE #\n" + "################################################################\n" + "# `-T` option has been deprecated in favour of `win-title`. #\n" + "# Please read the `WINDOW TITLE` section of the manpage for #\n" + "# more info. #\n" + "################################################################" + ); +} + static void print_version(void) { puts("nsxiv " VERSION); @@ -69,8 +80,6 @@ void parse_options(int argc, char **argv) _options.hide_bar = false; _options.geometry = NULL; _options.res_name = NULL; - _options.title_prefix = TITLE_PREFIX; - _options.title_suffixmode = TITLE_SUFFIXMODE; _options.quiet = false; _options.thumb_mode = false; @@ -155,14 +164,7 @@ void parse_options(int argc, char **argv) _options.scalemode = s - scalemodes; break; case 'T': - if ((s = strrchr(optarg, ':')) != NULL) { - *s = '\0'; - n = strtol(++s, &end, 0); - if (*end != '\0' || n < SUFFIX_EMPTY || n > SUFFIX_FULLPATH) - error(EXIT_FAILURE, 0, "Invalid argument for option -T suffixmode: %s", s); - _options.title_suffixmode = n; - } - _options.title_prefix = optarg; + title_deprecation_notice(); /* TODO(v30): remove this option */ break; case 't': _options.thumb_mode = true; -- cgit v1.2.3-54-g00ecf