swaysavetree: match workspace by number too

--workspace was documented as accepting a name or a number, but
the lookup only compared against the IPC name, so common
workspaces such as "1: web" (num=1) could not be selected with
--workspace 1. Parse a numeric argument and also compare against
the num field. Update the manpage accordingly.
This commit is contained in:
codegax 2026-05-02 17:25:00 -06:00
parent 6382fe1469
commit 54b95f6196
2 changed files with 23 additions and 5 deletions

View file

@ -25,7 +25,9 @@ This is the sway counterpart of i3-save-tree(1).
# OPTIONS
*--workspace* <name>
Name (or number, as a string) of the workspace to dump. Required.
Name or number of the workspace to dump. Required. If the argument is
all digits, it is also matched against the workspace's number, so
*--workspace 1* finds a workspace named "1: web".
*-h, --help*
Show help and exit.