mirror of
https://github.com/SerenityOS/serenity.git
synced 2026-11-07 04:29:30 -10:00
Utilities/ln: Add verbose option
This commit is contained in:
1 parent
81acf52721
commit
f1d48dea7a
1 file changed
+5
@@ -14,12 +14,14 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
|
||||
bool force = false;
|
||||
bool symbolic = false;
|
||||
bool verbose = false;
|
||||
StringView target;
|
||||
StringView path;
|
||||
|
||||
Core::ArgsParser args_parser;
|
||||
args_parser.add_option(force, "Force the creation", "force", 'f');
|
||||
args_parser.add_option(symbolic, "Create a symlink", "symbolic", 's');
|
||||
args_parser.add_option(verbose, "Verbose", "verbose", 'v');
|
||||
args_parser.add_positional_argument(target, "Link target", "target");
|
||||
args_parser.add_positional_argument(path, "Link path", "path", Core::ArgsParser::Required::No);
|
||||
args_parser.parse(arguments);
|
||||
@@ -52,5 +54,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
TRY(Core::System::link(target, path));
|
||||
}
|
||||
|
||||
if (verbose)
|
||||
outln("'{}' -> '{}'", path, target);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user