Do not support general commands in filter mode
This commit is contained in:
parent
84d70f8aeb
commit
dc30b0e6d6
12
src/main.cc
12
src/main.cc
|
@ -714,20 +714,17 @@ int run_server(StringView session, StringView server_init,
|
||||||
return local_client_exit;
|
return local_client_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
int run_filter(StringView keystr, StringView commands, ConstArrayView<StringView> files, bool quiet, StringView suffix_backup)
|
int run_filter(StringView keystr, ConstArrayView<StringView> files, bool quiet, StringView suffix_backup)
|
||||||
{
|
{
|
||||||
StringRegistry string_registry;
|
StringRegistry string_registry;
|
||||||
GlobalScope global_scope;
|
GlobalScope global_scope;
|
||||||
EventManager event_manager;
|
EventManager event_manager;
|
||||||
ShellManager shell_manager{builtin_env_vars};
|
ShellManager shell_manager{builtin_env_vars};
|
||||||
CommandManager command_manager;
|
|
||||||
RegisterManager register_manager;
|
RegisterManager register_manager;
|
||||||
ClientManager client_manager;
|
|
||||||
BufferManager buffer_manager;
|
BufferManager buffer_manager;
|
||||||
|
|
||||||
register_options();
|
register_options();
|
||||||
register_registers();
|
register_registers();
|
||||||
register_commands();
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -742,10 +739,6 @@ int run_filter(StringView keystr, StringView commands, ConstArrayView<StringView
|
||||||
Context::Flags::Transient
|
Context::Flags::Transient
|
||||||
};
|
};
|
||||||
|
|
||||||
if (not commands.empty())
|
|
||||||
command_manager.execute(commands, input_handler.context(),
|
|
||||||
ShellContext{});
|
|
||||||
|
|
||||||
for (auto& key : keys)
|
for (auto& key : keys)
|
||||||
input_handler.handle_key(key);
|
input_handler.handle_key(key);
|
||||||
}
|
}
|
||||||
|
@ -942,8 +935,7 @@ int main(int argc, char* argv[])
|
||||||
for (size_t i = 0; i < parser.positional_count(); ++i)
|
for (size_t i = 0; i < parser.positional_count(); ++i)
|
||||||
files.emplace_back(parser[i]);
|
files.emplace_back(parser[i]);
|
||||||
|
|
||||||
return run_filter(*keys, client_init, files,
|
return run_filter(*keys, files, (bool)parser.get_switch("q"),
|
||||||
(bool)parser.get_switch("q"),
|
|
||||||
parser.get_switch("i").value_or(StringView{}));
|
parser.get_switch("i").value_or(StringView{}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user