aboutsummaryrefslogtreecommitdiffstats
path: root/options.c
diff options
context:
space:
mode:
authorN-R-K <79544946+N-R-K@users.noreply.github.com>2022-02-23 10:23:22 +0100
committerGitHub <noreply@github.com>2022-02-23 10:23:22 +0100
commite26c81fe9ab43ef0148f51464dbae0f7a0e2b91e (patch)
treed65b9950f1c9310e40490302d77782c182a47377 /options.c
parentad95012be993664e062e7724155c54a482a51315 (diff)
downloadnsxiv-e26c81fe9ab43ef0148f51464dbae0f7a0e2b91e.tar.zst
use win-title script for customizing window title (#213)
this removes the cli flag `-T` as well as related config.h options. Co-authored-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
Diffstat (limited to 'options.c')
-rw-r--r--options.c28
1 files changed, 15 insertions, 13 deletions
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 <stdlib.h>
@@ -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;