libos+ls: Allow calling ArgumentParser::short_usage() directly
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
apio 2023-05-28 21:57:04 +02:00
parent 51a5727c8d
commit d40654a00c
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 3 additions and 2 deletions

View File

@ -113,7 +113,7 @@ Result<int> luna_main(int argc, char** argv)
else else
{ {
os::eprintln("%s: unknown sort type: %s", argv[0], sort_type.chars()); os::eprintln("%s: unknown sort type: %s", argv[0], sort_type.chars());
return 1; parser.short_usage(argv[0]);
} }
if (os::FileSystem::is_directory(pathname, follow_symlink_args) && !list_directories) if (os::FileSystem::is_directory(pathname, follow_symlink_args) && !list_directories)

View File

@ -41,6 +41,8 @@ namespace os
* Should not be used otherwise. */ * Should not be used otherwise. */
void add_system_program_info(StringView name); void add_system_program_info(StringView name);
void short_usage(StringView program_name);
private: private:
struct PositionalArgument struct PositionalArgument
{ {
@ -69,7 +71,6 @@ namespace os
}; };
Result<void> usage(StringView program_name); Result<void> usage(StringView program_name);
void short_usage(StringView program_name);
void version(); void version();