chiark / gitweb /
dgit: Drop an obsolete xxx comment
[dgit.git] / Debian / Dgit / ExitStatus.pm
1 # -*- perl -*-
2
3 package Debian::Dgit::ExitStatus;
4
5 # To use this, at the top (before use strict, even):
6 #
7 #   END { $? = $Debian::Dgit::ExitStatus::desired // -1; };
8 #   use Debian::Dgit::ExitStatus;
9 #
10 # and then replace every call to `exit' with `finish'.
11 # Add a `finish 0' to the end of the program.
12
13 BEGIN {
14     use Exporter;
15     @ISA = qw(Exporter);
16     @EXPORT = qw(finish $desired);
17 }
18
19 our $desired;
20
21 sub finish ($) {
22     $desired = $_[0] // 0;
23     exit $desired;
24 }
25
26 1;