From a2fb0768ffe6febd36dea8e2528e5a364d3b46f5 Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Tue, 20 Jun 2023 18:06:36 +0100 Subject: [PATCH] strings: Add commonly used long option names for `-n` and `-t` --- Base/usr/share/man/man1/strings.md | 6 +++--- Userland/Utilities/strings.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Base/usr/share/man/man1/strings.md b/Base/usr/share/man/man1/strings.md index 8635584352..06d0086a75 100644 --- a/Base/usr/share/man/man1/strings.md +++ b/Base/usr/share/man/man1/strings.md @@ -5,7 +5,7 @@ strings - find printable strings in files ## Synopsis ```**sh -$ strings [-n NUMBER] [--print-file-name] [-t FORMAT] [PATHS...] +$ strings [--bytes NUMBER] [--print-file-name] [--radix FORMAT] [PATHS...] ``` ## Description @@ -14,9 +14,9 @@ $ strings [-n NUMBER] [--print-file-name] [-t FORMAT] [PATHS...] ## Options -* `-n NUMBER`: Specify the minimum string length (4 is default). +* `-n NUMBER`, `--bytes NUMBER`: Specify the minimum string length (4 is default). * `-f`, `--print-file-name`: Print the name of the file before each string. -* `-t FORMAT`: Write each string preceded by its byte offset from the start of the file in the specified `FORMAT`, where `FORMAT` matches one of the following: `d` (decimal), `o` (octal), or `x` (hexidecimal). +* `-t FORMAT`, `--radix FORMAT`: Write each string preceded by its byte offset from the start of the file in the specified `FORMAT`, where `FORMAT` matches one of the following: `d` (decimal), `o` (octal), or `x` (hexidecimal). ## Examples diff --git a/Userland/Utilities/strings.cpp b/Userland/Utilities/strings.cpp index a3d14b77c8..5b200a2692 100644 --- a/Userland/Utilities/strings.cpp +++ b/Userland/Utilities/strings.cpp @@ -99,11 +99,11 @@ ErrorOr serenity_main(Main::Arguments arguments) StringOffsetFormat string_offset_format { StringOffsetFormat::None }; Core::ArgsParser args_parser; - args_parser.add_option(minimum_string_length, "Specify the minimum string length.", nullptr, 'n', "number"); + args_parser.add_option(minimum_string_length, "Specify the minimum string length.", "bytes", 'n', "number"); args_parser.add_option(show_paths, "Print the name of the file before each string.", "print-file-name", 'f'); args_parser.add_option({ Core::ArgsParser::OptionArgumentMode::Required, "Write offset relative to start of each file in (d)ec, (o)ct, or he(x) format.", - nullptr, + "radix", 't', "format", [&string_offset_format](StringView value) {