parent
71e362e2f9
commit
a2e90c2c25
|
@ -351,6 +351,11 @@ Vector<String> list_files(StringView prefix, StringView dirname,
|
||||||
return result.empty() ? subseq_result : result;
|
return result.empty() ? subseq_result : result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vector<String> list_files(StringView directory)
|
||||||
|
{
|
||||||
|
return list_files("", directory, [](const dirent&) { return true; });
|
||||||
|
}
|
||||||
|
|
||||||
CandidateList complete_filename(StringView prefix,
|
CandidateList complete_filename(StringView prefix,
|
||||||
const Regex& ignored_regex,
|
const Regex& ignored_regex,
|
||||||
ByteCount cursor_pos)
|
ByteCount cursor_pos)
|
||||||
|
|
|
@ -48,6 +48,8 @@ void write_buffer_to_backup_file(Buffer& buffer);
|
||||||
|
|
||||||
String find_file(StringView filename, ConstArrayView<String> paths);
|
String find_file(StringView filename, ConstArrayView<String> paths);
|
||||||
|
|
||||||
|
Vector<String> list_files(StringView directory);
|
||||||
|
|
||||||
void make_directory(StringView dir);
|
void make_directory(StringView dir);
|
||||||
|
|
||||||
time_t get_fs_timestamp(StringView filename);
|
time_t get_fs_timestamp(StringView filename);
|
||||||
|
|
|
@ -580,7 +580,8 @@ int main(int argc, char* argv[])
|
||||||
{ "p", { true, "just send stdin as commands to the given session" } },
|
{ "p", { true, "just send stdin as commands to the given session" } },
|
||||||
{ "f", { true, "act as a filter, executing given keys on given files" } },
|
{ "f", { true, "act as a filter, executing given keys on given files" } },
|
||||||
{ "q", { false, "in filter mode, be quiet about errors applying keys" } },
|
{ "q", { false, "in filter mode, be quiet about errors applying keys" } },
|
||||||
{ "u", { false, "use a dummy user interface, for testing purposes" } } }
|
{ "u", { false, "use a dummy user interface, for testing purposes" } },
|
||||||
|
{ "l", { false, "list existing sessions" } } }
|
||||||
};
|
};
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -590,6 +591,12 @@ int main(int argc, char* argv[])
|
||||||
|
|
||||||
ParametersParser parser(params, param_desc);
|
ParametersParser parser(params, param_desc);
|
||||||
|
|
||||||
|
if (parser.get_switch("l"))
|
||||||
|
{
|
||||||
|
for (auto& file : list_files(format("/tmp/kakoune/{}/", getlogin())))
|
||||||
|
write_stdout(format("{}\n", file));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if (auto session = parser.get_switch("p"))
|
if (auto session = parser.get_switch("p"))
|
||||||
{
|
{
|
||||||
for (auto opt : { "c", "n", "s", "d", "e" })
|
for (auto opt : { "c", "n", "s", "d", "e" })
|
||||||
|
|
Loading…
Reference in New Issue
Block a user