Validate command line args to @ goto-layout better
This commit is contained in:
parent
e089e9c121
commit
4125ac013f
@ -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…
x
Reference in New Issue
Block a user