mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-06-24 18:07:01 +00:00
Validate command line args to @ goto-layout better
This commit is contained in:
parent
e089e9c121
commit
4125ac013f
1 changed files with 3 additions and 4 deletions
|
|
@ -29,10 +29,9 @@ class GotoLayout(RemoteCommand):
|
|||
argspec = 'LAYOUT_NAME'
|
||||
|
||||
def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType:
|
||||
try:
|
||||
return {'layout': args[0], 'match': opts.match}
|
||||
except IndexError:
|
||||
raise self.fatal('No layout specified')
|
||||
if len(args) != 1:
|
||||
self.fatal('Exactly one layout must be specified')
|
||||
return {'layout': args[0], 'match': opts.match}
|
||||
|
||||
def response_from_kitty(self, boss: Boss, window: Optional[Window], payload_get: PayloadGetType) -> ResponseType:
|
||||
tabs = self.tabs_for_match_payload(boss, window, payload_get)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue