5 # Copyright © 2022 Guillem Jover <guillem@debian.org>
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <https://www.gnu.org/licenses/>.
25 use Dpkg
::ErrorHandling
;
26 use Dpkg
::BuildAPI
qw(get_build_api);
27 use Dpkg
::Control
::Info
;
29 textdomain
('dpkg-dev');
33 printf(g_
("Debian %s version %s.\n"), $Dpkg::PROGNAME
, $Dpkg::PROGVERSION
);
38 printf(g_
("Usage: %s [<option>...]\n"), $Dpkg::PROGNAME
);
42 -c<control-file> get control info from this file.
43 -?, --help show this help message.
44 -v, --version show the version.
48 my $controlfile = 'debian/control';
52 if (m/^-\?|--help$/) {
55 } elsif (m/^-v|--version$/) {
58 } elsif (m/-c(.*)$/) {
63 usageerr
(g_
("unknown option '%s'"), $_);
65 usageerr
(g_
('no arguments accepted'));
69 my $ctrl = Dpkg
::Control
::Info
->new($controlfile);
71 print get_build_api
($ctrl) . "\n";