mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-19 06:54:58 +02:00
Simplify handling of --no-response
This commit is contained in:
@@ -32,8 +32,6 @@ using this option means that you will not be notified of failures.
|
||||
argspec = ''
|
||||
|
||||
def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType:
|
||||
if opts.no_response:
|
||||
global_opts.no_command_response = True
|
||||
return {'match': opts.match}
|
||||
|
||||
def response_from_kitty(self, boss: Boss, window: Optional[Window], payload_get: PayloadGetType) -> ResponseType:
|
||||
|
||||
@@ -32,8 +32,6 @@ the command will exit with a success code.
|
||||
'''
|
||||
|
||||
def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType:
|
||||
if opts.no_response:
|
||||
global_opts.no_command_response = True
|
||||
return {'match': opts.match, 'no_response': opts.no_response}
|
||||
|
||||
def response_from_kitty(self, boss: Boss, window: Optional[Window], payload_get: PayloadGetType) -> ResponseType:
|
||||
|
||||
@@ -37,8 +37,6 @@ the command will exit with a success code.
|
||||
''' + '\n\n\n' + MATCH_TAB_OPTION
|
||||
|
||||
def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType:
|
||||
if opts.no_response:
|
||||
global_opts.no_command_response = True
|
||||
return {'match': opts.match, 'all': opts.all}
|
||||
|
||||
def response_from_kitty(self, boss: Boss, window: Optional[Window], payload_get: PayloadGetType) -> ResponseType:
|
||||
|
||||
@@ -63,8 +63,6 @@ instead of the active tab
|
||||
argspec = '[CMD ...]'
|
||||
|
||||
def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType:
|
||||
if opts.no_response:
|
||||
global_opts.no_command_response = True
|
||||
ans = {'args': args or []}
|
||||
for attr, val in opts.__dict__.items():
|
||||
ans[attr] = val
|
||||
|
||||
@@ -78,8 +78,6 @@ the id of the new window will not be printed out.
|
||||
argspec = '[CMD ...]'
|
||||
|
||||
def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType:
|
||||
if opts.no_response:
|
||||
global_opts.no_command_response = True
|
||||
return {'match': opts.match, 'title': opts.title, 'cwd': opts.cwd,
|
||||
'new_tab': opts.new_tab, 'tab_title': opts.tab_title,
|
||||
'window_type': opts.window_type, 'no_response': opts.no_response,
|
||||
|
||||
@@ -74,8 +74,6 @@ using this option means that you will not be notified of failures.
|
||||
argspec = ''
|
||||
|
||||
def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType:
|
||||
if opts.no_response:
|
||||
global_opts.no_command_response = True
|
||||
return {
|
||||
'match': opts.match, 'action': opts.action, 'unit': opts.unit,
|
||||
'width': opts.width, 'height': opts.height, 'self': opts.self,
|
||||
|
||||
@@ -67,8 +67,6 @@ failed, the command will exit with a success code.
|
||||
def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType:
|
||||
if len(args) != 1:
|
||||
self.fatal('Must specify path to exactly one PNG image')
|
||||
if opts.no_response:
|
||||
global_opts.no_command_response = True
|
||||
path = args[0]
|
||||
ret = {
|
||||
'match': opts.match,
|
||||
|
||||
Reference in New Issue
Block a user