From dcd1653aa2d70b1bb1e6102a5478ceb500e1ff3e Mon Sep 17 00:00:00 2001 From: Nathaniel Young Date: Sun, 25 Sep 2022 02:23:02 +0000 Subject: [PATCH] feat: adds dry run --- bin/alfa.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/alfa.dart b/bin/alfa.dart index d0d4152..0021ae1 100644 --- a/bin/alfa.dart +++ b/bin/alfa.dart @@ -21,6 +21,8 @@ void main(List args) async { var parser = ArgParser(); parser.addFlag('help', abbr: 'h', help: 'Print this usage information.', negatable: false); + parser.addFlag('dry-run', + abbr: 'n', help: 'Only prints what will be installed.', negatable: false); parser.addFlag('exit', abbr: 'e', help: @@ -169,6 +171,12 @@ void main(List args) async { print(''); print('--------------------------------------------'); + // exits if dry run is set to true + if (argResults['dry-run']) { + print('Exiting alfa, dry run mode enabled.'); + exit(0); + } + // sets executable String executable; if (user == null || user == 'root') {