maps: Drop bmap flags syntax deprecated in 4.3.27
Deprecated in commit a00f9e2
: 'r' with flags, and bad flags after 't'.
Affects flags argument of bmap, sbmap, pbmap, lbmap, nbmap, and
navigate and march sub-command 'B'.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
f150d9cb9f
commit
f374ef64dd
1 changed files with 0 additions and 29 deletions
|
@ -119,21 +119,11 @@ parse_map_arg(int unit_type, char *arg,
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
warn_deprecated_arg(char *what, char *arg, char *use)
|
|
||||||
{
|
|
||||||
pr("%s '%s' is deprecated and will go away in a future release.\n"
|
|
||||||
"Use %s instead.\n",
|
|
||||||
what, arg, use);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
parse_map_flags(int bmap, char *str)
|
parse_map_flags(int bmap, char *str)
|
||||||
{
|
{
|
||||||
int map_flags;
|
int map_flags;
|
||||||
char *p;
|
char *p;
|
||||||
int tflags = 0;
|
|
||||||
char *tp = NULL;
|
|
||||||
|
|
||||||
switch (bmap) {
|
switch (bmap) {
|
||||||
default: CANT_REACH();
|
default: CANT_REACH();
|
||||||
|
@ -179,28 +169,9 @@ parse_map_flags(int bmap, char *str)
|
||||||
if (bmap != 'b')
|
if (bmap != 'b')
|
||||||
goto bad_flag;
|
goto bad_flag;
|
||||||
map_flags |= MAP_ALT;
|
map_flags |= MAP_ALT;
|
||||||
/*
|
|
||||||
* Flags following 't' used to be ignored. That breaks
|
|
||||||
* perfectly sensible "ts". Try to continue, but save
|
|
||||||
* state for when a bad flag is found.
|
|
||||||
*/
|
|
||||||
if (!tflags) {
|
|
||||||
tflags = map_flags;
|
|
||||||
tp = p;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'r':
|
|
||||||
if (bmap != 'b' || tflags)
|
|
||||||
goto bad_flag;
|
|
||||||
warn_deprecated_arg("Map flag", "r", "argument 'revert'");
|
|
||||||
return MAP_BMAP_REVERT;
|
|
||||||
default:
|
default:
|
||||||
bad_flag:
|
bad_flag:
|
||||||
if (tflags) {
|
|
||||||
/* ignore bad flags following 't' */
|
|
||||||
warn_deprecated_arg("Argument", tp, "map flag 't'");
|
|
||||||
return tflags;
|
|
||||||
}
|
|
||||||
pr("Bad flag %c!\n", *p);
|
pr("Bad flag %c!\n", *p);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue