summaryrefslogtreecommitdiff
path: root/Userland/Utilities
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Utilities')
-rw-r--r--Userland/Utilities/asctl.cpp4
-rw-r--r--Userland/Utilities/cat.cpp2
-rw-r--r--Userland/Utilities/checksum.cpp2
-rw-r--r--Userland/Utilities/cp.cpp2
-rw-r--r--Userland/Utilities/cut.cpp4
-rw-r--r--Userland/Utilities/gunzip.cpp2
-rw-r--r--Userland/Utilities/gzip.cpp6
-rw-r--r--Userland/Utilities/js.cpp2
-rw-r--r--Userland/Utilities/ls.cpp4
-rw-r--r--Userland/Utilities/rev.cpp4
-rw-r--r--Userland/Utilities/sysctl.cpp4
-rw-r--r--Userland/Utilities/tac.cpp4
-rw-r--r--Userland/Utilities/zip.cpp2
13 files changed, 21 insertions, 21 deletions
diff --git a/Userland/Utilities/asctl.cpp b/Userland/Utilities/asctl.cpp
index 8d064880d7..28749d5f47 100644
--- a/Userland/Utilities/asctl.cpp
+++ b/Userland/Utilities/asctl.cpp
@@ -30,7 +30,7 @@ int main(int argc, char** argv)
auto audio_client = Audio::ClientConnection::construct();
String command = String::empty();
- Vector<String> arguments;
+ Vector<StringView> arguments;
bool human_mode = false;
Core::ArgsParser args_parser;
@@ -113,7 +113,7 @@ int main(int argc, char** argv)
}
values_to_set.set(AudioVariable::Volume, volume.value());
} else if (variable.is_one_of("m"sv, "mute"sv)) {
- String& mute_text = arguments[++i];
+ auto& mute_text = arguments[++i];
bool mute;
if (mute_text.equals_ignoring_case("true") || mute_text == "1") {
mute = true;
diff --git a/Userland/Utilities/cat.cpp b/Userland/Utilities/cat.cpp
index c749cbeff5..aa9dda6bb8 100644
--- a/Userland/Utilities/cat.cpp
+++ b/Userland/Utilities/cat.cpp
@@ -20,7 +20,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{
TRY(Core::System::pledge("stdio rpath", nullptr));
- Vector<String> paths;
+ Vector<StringView> paths;
Core::ArgsParser args_parser;
args_parser.set_general_help("Concatenate files or pipes to stdout.");
diff --git a/Userland/Utilities/checksum.cpp b/Userland/Utilities/checksum.cpp
index 254df5bd5a..03971b8b28 100644
--- a/Userland/Utilities/checksum.cpp
+++ b/Userland/Utilities/checksum.cpp
@@ -36,7 +36,7 @@ int main(int argc, char** argv)
auto hash_name = program_name.substring_view(0, program_name.length() - 3).to_string().to_uppercase();
auto paths_help_string = String::formatted("File(s) to print {} checksum of", hash_name);
- Vector<String> paths;
+ Vector<StringView> paths;
Core::ArgsParser args_parser;
args_parser.add_positional_argument(paths, paths_help_string.characters(), "path", Core::ArgsParser::Required::No);
diff --git a/Userland/Utilities/cp.cpp b/Userland/Utilities/cp.cpp
index b5b1cfa668..d6d1fb4599 100644
--- a/Userland/Utilities/cp.cpp
+++ b/Userland/Utilities/cp.cpp
@@ -21,7 +21,7 @@ int main(int argc, char** argv)
bool preserve = false;
bool recursion_allowed = false;
bool verbose = false;
- Vector<String> sources;
+ Vector<StringView> sources;
String destination;
Core::ArgsParser args_parser;
diff --git a/Userland/Utilities/cut.cpp b/Userland/Utilities/cut.cpp
index c50684d103..c035c5b38b 100644
--- a/Userland/Utilities/cut.cpp
+++ b/Userland/Utilities/cut.cpp
@@ -153,7 +153,7 @@ int main(int argc, char** argv)
String fields_list = "";
String delimiter = "\t";
- Vector<String> files;
+ Vector<StringView> files;
Core::ArgsParser args_parser;
args_parser.add_positional_argument(files, "file(s) to cut", "file", Core::ArgsParser::Required::No);
@@ -230,7 +230,7 @@ int main(int argc, char** argv)
for (auto& file : files) {
FILE* fp = stdin;
if (!file.is_null()) {
- fp = fopen(file.characters(), "r");
+ fp = fopen(String(file).characters(), "r");
if (!fp) {
warnln("cut: Could not open file '{}'", file);
continue;
diff --git a/Userland/Utilities/gunzip.cpp b/Userland/Utilities/gunzip.cpp
index 589e0ddd3d..b2743406b4 100644
--- a/Userland/Utilities/gunzip.cpp
+++ b/Userland/Utilities/gunzip.cpp
@@ -25,7 +25,7 @@ static bool decompress_file(Buffered<Core::InputFileStream>& input_stream, Buffe
int main(int argc, char** argv)
{
- Vector<String> filenames;
+ Vector<StringView> filenames;
bool keep_input_files { false };
bool write_to_stdout { false };
diff --git a/Userland/Utilities/gzip.cpp b/Userland/Utilities/gzip.cpp
index 71bf648520..18cefb442a 100644
--- a/Userland/Utilities/gzip.cpp
+++ b/Userland/Utilities/gzip.cpp
@@ -12,7 +12,7 @@
int main(int argc, char** argv)
{
- Vector<String> filenames;
+ Vector<StringView> filenames;
bool keep_input_files { false };
bool write_to_stdout { false };
bool decompress { false };
@@ -34,7 +34,7 @@ int main(int argc, char** argv)
warnln("unknown suffix for: {}, skipping", input_filename);
continue;
}
- output_filename = input_filename.substring(0, input_filename.length() - ".gz"sv.length());
+ output_filename = input_filename.substring_view(0, input_filename.length() - ".gz"sv.length());
} else {
output_filename = String::formatted("{}.gz", input_filename);
}
@@ -78,7 +78,7 @@ int main(int argc, char** argv)
}
if (!keep_input_files) {
- const auto retval = unlink(input_filename.characters());
+ const auto retval = unlink(String(input_filename).characters());
if (retval != 0) {
warnln("Failed removing input file");
return 1;
diff --git a/Userland/Utilities/js.cpp b/Userland/Utilities/js.cpp
index e433be05ac..22bb3675c6 100644
--- a/Userland/Utilities/js.cpp
+++ b/Userland/Utilities/js.cpp
@@ -1163,7 +1163,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
bool gc_on_every_allocation = false;
bool disable_syntax_highlight = false;
- Vector<String> script_paths;
+ Vector<StringView> script_paths;
Core::ArgsParser args_parser;
args_parser.set_general_help("This is a JavaScript interpreter.");
diff --git a/Userland/Utilities/ls.cpp b/Userland/Utilities/ls.cpp
index 8704f5caf3..39614ed889 100644
--- a/Userland/Utilities/ls.cpp
+++ b/Userland/Utilities/ls.cpp
@@ -98,7 +98,7 @@ int main(int argc, char** argv)
return 1;
}
- Vector<String> paths;
+ Vector<StringView> paths;
Core::ArgsParser args_parser;
args_parser.set_general_help("List files in a directory.");
@@ -148,7 +148,7 @@ int main(int argc, char** argv)
FileMetadata metadata;
metadata.name = path;
- int rc = lstat(path.characters(), &metadata.stat);
+ int rc = lstat(String(path).characters(), &metadata.stat);
if (rc < 0)
perror("lstat");
diff --git a/Userland/Utilities/rev.cpp b/Userland/Utilities/rev.cpp
index 5b42754203..5fb4498ad7 100644
--- a/Userland/Utilities/rev.cpp
+++ b/Userland/Utilities/rev.cpp
@@ -16,7 +16,7 @@ int main(int argc, char** argv)
return 1;
}
- Vector<String> paths;
+ Vector<StringView> paths;
Core::ArgsParser args_parser;
args_parser.set_general_help("Concatente files to stdout with each line in reverse.");
@@ -29,7 +29,7 @@ int main(int argc, char** argv)
if (!paths.is_empty()) {
for (auto const& path : paths) {
- FILE* stream = fopen(path.characters(), "r");
+ FILE* stream = fopen(String(path).characters(), "r");
if (!stream) {
warnln("Failed to open {}: {}", path, strerror(errno));
continue;
diff --git a/Userland/Utilities/sysctl.cpp b/Userland/Utilities/sysctl.cpp
index 8d1a357374..f339ddf2f8 100644
--- a/Userland/Utilities/sysctl.cpp
+++ b/Userland/Utilities/sysctl.cpp
@@ -54,7 +54,7 @@ static bool write_variable(StringView name, StringView value)
return true;
}
-static int handle_variables(Vector<String> const& variables)
+static int handle_variables(Vector<StringView> const& variables)
{
bool success = false;
for (auto const& variable : variables) {
@@ -95,7 +95,7 @@ static int handle_show_all()
int main(int argc, char** argv)
{
bool show_all = false;
- Vector<String> variables;
+ Vector<StringView> variables;
Core::ArgsParser args_parser;
args_parser.set_general_help("Show or modify system-internal values. This requires root, and can crash your system.");
diff --git a/Userland/Utilities/tac.cpp b/Userland/Utilities/tac.cpp
index 8568677421..e668115801 100644
--- a/Userland/Utilities/tac.cpp
+++ b/Userland/Utilities/tac.cpp
@@ -16,7 +16,7 @@ int main(int argc, char** argv)
return 1;
}
- Vector<String> paths;
+ Vector<StringView> paths;
Core::ArgsParser args_parser;
args_parser.set_general_help("Concatenate files or pipes to stdout, last line first.");
@@ -33,7 +33,7 @@ int main(int argc, char** argv)
if (path == "-"sv) {
stream = stdin;
} else {
- stream = fopen(path.characters(), "r");
+ stream = fopen(String(path).characters(), "r");
if (!stream) {
warnln("Failed to open {}: {}", path, strerror(errno));
continue;
diff --git a/Userland/Utilities/zip.cpp b/Userland/Utilities/zip.cpp
index 8ecf1b65e4..0f68c8f304 100644
--- a/Userland/Utilities/zip.cpp
+++ b/Userland/Utilities/zip.cpp
@@ -16,7 +16,7 @@
int main(int argc, char** argv)
{
const char* zip_path;
- Vector<String> source_paths;
+ Vector<StringView> source_paths;
bool recurse = false;
bool force = false;