diff --git a/Base/usr/share/man/man1/strings.md b/Base/usr/share/man/man1/strings.md index 06d0086a75..22cce4b9e5 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 [--bytes NUMBER] [--print-file-name] [--radix FORMAT] [PATHS...] +$ strings [--bytes NUMBER] [--print-file-name] [-o] [--radix FORMAT] [PATHS...] ``` ## Description @@ -16,6 +16,7 @@ $ strings [--bytes NUMBER] [--print-file-name] [--radix FORMAT] [PATHS...] * `-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. +* `-o`: Equivalent to specifying `-t o`. * `-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 5b200a2692..abcc46a75a 100644 --- a/Userland/Utilities/strings.cpp +++ b/Userland/Utilities/strings.cpp @@ -118,6 +118,15 @@ ErrorOr serenity_main(Main::Arguments arguments) } return true; } }); + args_parser.add_option({ Core::ArgsParser::OptionArgumentMode::None, + "Equivalent to specifying -t o.", + nullptr, + 'o', + nullptr, + [&string_offset_format](auto) { + string_offset_format = StringOffsetFormat::Octal; + return true; + } }); args_parser.set_general_help("Write the sequences of printable characters in files or pipes to stdout."); args_parser.add_positional_argument(paths, "File path", "path", Core::ArgsParser::Required::No); args_parser.parse(arguments);