From: Naeem Model Date: Tue, 13 May 2025 14:46:54 +0000 (+0000) Subject: Add option to fork processes X-Git-Url: https://git.nmode.ca/Fey/commitdiff_plain/c148fbed0ac58a145abe1be864ebbf60cd8b96e9?hp=9b3457a8dba8fccac63591eef54812994e1178e0 Add option to fork processes --- diff --git a/lib/App/Fey.pm b/lib/App/Fey.pm index 9939a5c..89f6535 100644 --- a/lib/App/Fey.pm +++ b/lib/App/Fey.pm @@ -30,6 +30,11 @@ sub launch { die "No files or URIs specified.\n" unless @_; ARG: for my $file_or_uri (@_) { + if ($options->{fork} && !$options->{single}) { + my $pid = fork; + next ARG if ($pid); + } + if ($file_or_uri =~ m|^file://(.+)|) { $file_or_uri = $1; } @@ -52,6 +57,7 @@ sub launch { return; } $associations->{$context}->($file_or_uri); + return if ($options->{fork}); next ARG; } }