Skip to content

Commit f036f59

Browse files
committed
Window: Add show_option(), deprecate show_window_option()
1 parent b03ac68 commit f036f59

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

src/libtmux/window.py

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,11 +420,21 @@ def set_option(
420420
return self
421421

422422
def show_window_options(self, g: t.Optional[bool] = False) -> "WindowOptionDict":
423+
"""Show option for tmux window. Deprecated by :meth:`Window.show_options()`.
424+
425+
.. deprecated:: 0.26
426+
427+
Deprecated by :meth:`Window.show_options()`.
428+
423429
"""
424-
Return a dict of options for the window.
430+
warnings.warn("Window.show_window_options() is deprecated", stacklevel=2)
431+
return self.show_options(g=g)
432+
433+
def show_options(self, g: t.Optional[bool] = False) -> "WindowOptionDict":
434+
"""Return a dict of options for the window.
425435
426-
For familiarity with tmux, the option ``option`` param forwards to
427-
pick a single option, forwarding to :meth:`Window.show_window_option`.
436+
For familiarity with tmux, the option ``option`` param forwards to pick a
437+
single option, forwarding to :meth:`Window.show_option`.
428438
429439
.. versionchanged:: 0.13.0
430440
@@ -463,8 +473,20 @@ def show_window_options(self, g: t.Optional[bool] = False) -> "WindowOptionDict"
463473
def show_window_option(
464474
self, option: str, g: bool = False
465475
) -> t.Optional[t.Union[str, int]]:
476+
"""Return option for target window. Deprecated by :meth:`Window.show_option()`.
477+
478+
.. deprecated:: 0.26
479+
480+
Deprecated by :meth:`Window.show_option()`.
481+
466482
"""
467-
Return option value for the target window.
483+
warnings.warn("Window.show_window_option() is deprecated", stacklevel=2)
484+
return self.show_option(option=option, g=g)
485+
486+
def show_option(
487+
self, option: str, g: bool = False
488+
) -> t.Optional[t.Union[str, int]]:
489+
"""Return option value for the target window.
468490
469491
todo: test and return True/False for on/off string
470492

0 commit comments

Comments
 (0)