Commit graph

13 commits

Author SHA1 Message Date
Shannon Booth
1ec6399c00 Everywhere: Remove uneeded short option argument where possible 2024-04-22 08:10:08 +02:00
Cameron Youell
1d24f394c6 Everywhere: Use LibFileSystem where trivial 2023-03-21 19:03:21 +00:00
Ali Mohammad Pur
db886fe18b Userland+AK: Stop using getopt() for ArgsParser
This commit moves the implementation of getopt into AK, and converts its
API to understand and use StringView instead of char*.
Everything else is caught in the crossfire of making
Option::accept_value() take a StringView instead of a char const*.

With this, we must now pass a Span<StringView> to ArgsParser::parse(),
applications using LibMain are unaffected, but anything not using that
or taking its own argc/argv has to construct a Vector<StringView> for
this method.
2023-02-28 15:52:24 +03:30
Tim Schumacher
d43a7eae54 LibCore: Rename File to DeprecatedFile
As usual, this removes many unused includes and moves used includes
further down the chain.
2023-02-13 00:50:07 +00:00
Timothy Flynn
4a916cd379 Everywhere: Remove needless copies of Error / ErrorOr instances
Either take the underlying objects with release_* methods or move() the
instances around.
2023-02-10 09:08:52 +00:00
Tim Schumacher
9805f73704 LibCore: Remove the force parameter from File::remove
About half of the usages were not using `force` anyways, and the other
half presumably just got confused about what "force" really means in
this context (which is "ignore nonexistent files").

The only 'legitimate' user, which is `rm`, instead now handles this
completely internally instead.
2022-12-23 10:38:14 -05:00
Ariel Abreu
0fea2203dc rm: Port to LibMain 2022-01-25 02:50:10 +00:00
Lucas CHOLLET
4d557a4b81 rm: Check before removing '/'
A simple check to not erase '/' by mistake.
2022-01-02 17:37:35 +01:00
Andreas Kling
c7e62d448c LibCore: Use ErrorOr<T> for Core::File::remove()
This function returns a subclass of Error, which is now possible.
2021-11-08 00:35:27 +01:00
Tim Schumacher
f295ac3c0b rm: Allow empty paths if -f is specified
On most (if not all) systems rm ignores an empty paths array if -f or
--force is specified. This helps with scripts that may pass an empty
variable where the file paths are supposed to go.
2021-06-05 10:56:58 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Mițca Dumitru
ecafee86f8 rm: Use Core::File::remove 2021-02-21 18:14:29 +01:00
Andreas Kling
ececac65c2 Userland: Move command-line utilities to Userland/Utilities/ 2021-01-12 12:04:09 +01:00
Renamed from Userland/rm.cpp (Browse further)