mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:17:44 +00:00
strings: Add -o
option as an alias for -t o
This commit is contained in:
parent
a2fb0768ff
commit
c723101728
2 changed files with 11 additions and 1 deletions
|
@ -5,7 +5,7 @@ strings - find printable strings in files
|
||||||
## Synopsis
|
## Synopsis
|
||||||
|
|
||||||
```**sh
|
```**sh
|
||||||
$ strings [--bytes NUMBER] [--print-file-name] [--radix FORMAT] [PATHS...]
|
$ strings [--bytes NUMBER] [--print-file-name] [-o] [--radix FORMAT] [PATHS...]
|
||||||
```
|
```
|
||||||
|
|
||||||
## Description
|
## 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).
|
* `-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.
|
* `-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).
|
* `-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
|
## Examples
|
||||||
|
|
|
@ -118,6 +118,15 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
}
|
}
|
||||||
return true;
|
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.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.add_positional_argument(paths, "File path", "path", Core::ArgsParser::Required::No);
|
||||||
args_parser.parse(arguments);
|
args_parser.parse(arguments);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue