Skip to content

Commit 0f67cf2

Browse files
authored
Merge pull request #307 from desultory/dev
improve deprecated cmdline arg check
2 parents 142d382 + 79b240a commit 0f67cf2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ugrd/base/cmdline.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "desultory"
2-
__version__ = "4.2.0"
2+
__version__ = "4.2.1"
33

44
from importlib.metadata import PackageNotFoundError, version
55
from pathlib import Path
@@ -164,7 +164,8 @@ def check_proc_cmdline(self):
164164
self.logger.debug(f"Current cmdline: {c_(cmdline, 'green')}")
165165

166166
for arg in DEPRECATED_ARGS:
167-
if search(rf"\b{arg}(\b|=)", cmdline):
167+
# Check for deprecated args starting with a space or newline, ending with a space, =, or end of line
168+
if search(rf"(?:^|\s){arg}(?=\s|=|$)", cmdline):
168169
self.logger.warning(f"Detected deprecated cmdline arg: {c_(arg, 'red')}")
169170
self.logger.warning("Please check the documentation for the updated usage.")
170171

0 commit comments

Comments
 (0)