Utilities: Initialize raw variables to default values in some utilities
This commit is contained in:
parent
9275743626
commit
37d62c16f8
Notes:
sideshowbarker
2024-07-17 05:02:35 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/37d62c16f8 Pull-request: https://github.com/SerenityOS/serenity/pull/24147 Reviewed-by: https://github.com/timschumi ✅
6 changed files with 9 additions and 9 deletions
|
@ -28,9 +28,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
{
|
||||
TRY(Core::System::pledge("stdio rpath tty inet unix"));
|
||||
|
||||
static bool flag_set;
|
||||
static bool flag_delete;
|
||||
static bool flag_numeric;
|
||||
bool flag_set = false;
|
||||
bool flag_delete = false;
|
||||
bool flag_numeric = false;
|
||||
StringView value_ipv4_address;
|
||||
StringView value_hw_address;
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static bool volatile g_interrupted;
|
||||
static bool volatile g_interrupted = false;
|
||||
static void handle_sigint(int)
|
||||
{
|
||||
g_interrupted = true;
|
||||
|
|
|
@ -18,7 +18,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
Vector<String> inputs;
|
||||
String output_type;
|
||||
char glue = '-';
|
||||
bool spa;
|
||||
bool spa = false;
|
||||
|
||||
Core::ArgsParser parser;
|
||||
parser.set_general_help("Slugify is a simple text to slug transform utility\n$ slugify 'Serenity is a cool ### PROject123.'");
|
||||
|
|
|
@ -38,7 +38,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
bool xz = false;
|
||||
bool no_auto_compress = false;
|
||||
StringView archive_file;
|
||||
bool dereference;
|
||||
bool dereference = false;
|
||||
StringView directory;
|
||||
Vector<ByteString> paths;
|
||||
|
||||
|
|
|
@ -19,12 +19,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
}
|
||||
|
||||
ByteString host;
|
||||
int port;
|
||||
int port = 0;
|
||||
bool tls { false };
|
||||
|
||||
ByteString username;
|
||||
Core::SecretString password;
|
||||
bool interactive_password;
|
||||
bool interactive_password = false;
|
||||
|
||||
Core::ArgsParser args_parser;
|
||||
args_parser.add_option(interactive_password, "Prompt for password with getpass", "interactive", 'i');
|
||||
|
|
|
@ -96,7 +96,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Core::System::pledge("stdio rpath"));
|
||||
|
||||
StringView path;
|
||||
bool quiet;
|
||||
bool quiet = false;
|
||||
|
||||
Core::ArgsParser args_parser;
|
||||
args_parser.add_positional_argument(path, "Path to file", "path", Core::ArgsParser::Required::No);
|
||||
|
|
Loading…
Add table
Reference in a new issue