mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 21:27:34 +00:00
Userland: Rename cp's "-r" flag to "-R"
Linux accepts both -r and -R, but the BSDs only like -R, and dR POSIX also only mentions -R. So make -R the canonical flag. Keep -r available as an alias for -R.
This commit is contained in:
parent
56c2cc4162
commit
cf9135557b
1 changed files with 3 additions and 2 deletions
|
@ -57,7 +57,8 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
Core::ArgsParser args_parser;
|
Core::ArgsParser args_parser;
|
||||||
args_parser.add_option(link, "Link files instead of copying", "link", 'l');
|
args_parser.add_option(link, "Link files instead of copying", "link", 'l');
|
||||||
args_parser.add_option(recursion_allowed, "Copy directories recursively", "recursive", 'r');
|
args_parser.add_option(recursion_allowed, "Copy directories recursively", "recursive", 'R');
|
||||||
|
args_parser.add_option(recursion_allowed, "Same as -R", nullptr, 'r');
|
||||||
args_parser.add_option(verbose, "Verbose", "verbose", 'v');
|
args_parser.add_option(verbose, "Verbose", "verbose", 'v');
|
||||||
args_parser.add_positional_argument(sources, "Source file path", "source");
|
args_parser.add_positional_argument(sources, "Source file path", "source");
|
||||||
args_parser.add_positional_argument(destination, "Destination file path", "destination");
|
args_parser.add_positional_argument(destination, "Destination file path", "destination");
|
||||||
|
@ -99,7 +100,7 @@ bool copy_file_or_directory(String src_path, String dst_path, bool recursion_all
|
||||||
|
|
||||||
if (S_ISDIR(src_stat.st_mode)) {
|
if (S_ISDIR(src_stat.st_mode)) {
|
||||||
if (!recursion_allowed) {
|
if (!recursion_allowed) {
|
||||||
fprintf(stderr, "cp: -r not specified; omitting directory '%s'\n", src_path.characters());
|
fprintf(stderr, "cp: -R not specified; omitting directory '%s'\n", src_path.characters());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return copy_directory(src_path, dst_path, link);
|
return copy_directory(src_path, dst_path, link);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue