diff options
author | implicitfield <114500360+implicitfield@users.noreply.github.com> | 2022-12-18 12:59:02 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-12-20 10:44:02 +0100 |
commit | 9ae9d82a033c4f893d2a58c178d6a6e73e8d2b63 (patch) | |
tree | 25e320b1a212935002501ff2dfbbd43cd422ab8c /Userland | |
parent | a52089452226ce7327c5557ae10b8450b9cc2fee (diff) | |
download | serenity-9ae9d82a033c4f893d2a58c178d6a6e73e8d2b63.zip |
unzip: Use StringView instead of DeprecatedString
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Utilities/unzip.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Userland/Utilities/unzip.cpp b/Userland/Utilities/unzip.cpp index 39c7b1e07c..cfb206441b 100644 --- a/Userland/Utilities/unzip.cpp +++ b/Userland/Utilities/unzip.cpp @@ -85,20 +85,18 @@ static bool unpack_zip_member(Archive::ZipMember zip_member, bool quiet) ErrorOr<int> serenity_main(Main::Arguments arguments) { - char const* path; + StringView zip_file_path; bool quiet { false }; - DeprecatedString output_directory_path; + StringView output_directory_path; Vector<StringView> file_filters; Core::ArgsParser args_parser; args_parser.add_option(output_directory_path, "Directory to receive the archive content", "output-directory", 'd', "path"); args_parser.add_option(quiet, "Be less verbose", "quiet", 'q'); - args_parser.add_positional_argument(path, "File to unzip", "path", Core::ArgsParser::Required::Yes); + args_parser.add_positional_argument(zip_file_path, "File to unzip", "path", Core::ArgsParser::Required::Yes); args_parser.add_positional_argument(file_filters, "Files or filters in the archive to extract", "files", Core::ArgsParser::Required::No); args_parser.parse(arguments); - DeprecatedString zip_file_path { path }; - struct stat st = TRY(Core::System::stat(zip_file_path)); // FIXME: Map file chunk-by-chunk once we have mmap() with offset. |