Skip to content

Commit f9119d1

Browse files
committed
OptionsMixin(fix[show_option]): Add deprecation warning for g parameter
why: The g parameter should emit DeprecationWarning like set_option() does what: - Add deprecation warning when g parameter is used - Follow same pattern as set_option() (lines 669-671) - Ensures backward compatibility while guiding users to global_
1 parent 704bca2 commit f9119d1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/libtmux/options.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1208,9 +1208,13 @@ def show_option(
12081208
>>> MyServer().show_option('exit-unattached', global_=True)
12091209
False
12101210
"""
1211+
if g:
1212+
warnings.warn("g argument is deprecated in favor of global_", stacklevel=2)
1213+
global_ = g
1214+
12111215
return self._show_option(
12121216
option=option,
1213-
global_=global_ or g,
1217+
global_=global_,
12141218
scope=scope,
12151219
ignore_errors=ignore_errors,
12161220
include_hooks=include_hooks,

0 commit comments

Comments
 (0)