From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 407FB1F4B4; Sun, 24 Jan 2021 12:31:14 +0000 (UTC) Date: Sun, 24 Jan 2021 12:31:14 +0000 From: Eric Wong To: meta@public-inbox.org Subject: exit codes [was: [PATCH 5/9] lei q: honor --no-local to force remote searches] Message-ID: <20210124123114.GA10744@dcvr> References: <20210124114655.12815-1-e@80x24.org> <20210124114655.12815-6-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210124114655.12815-6-e@80x24.org> List-Id: Eric Wong wrote: > --- a/t/lei.t > +++ b/t/lei.t > @@ -277,6 +277,9 @@ my $test_external = sub { > } > ok(!$lei->('q', '-o', "$home/mbox", 's:nope'), > 'fails if mbox format unspecified'); > + ok(!$lei->(qw(q --no-local s:see)), '--no-local'); > + is($? >> 8, 1, 'proper exit code'); I'm wondering if BSD EX_* constants from sysexits.h makes sense for lei and if users will care, but keep in mind git doesn't use them. But they may conflict with curl(1) exit codes which we propagate back to the user. public-inbox-mda uses those codes because MTAs understand them; but I'm not sure if lei will be invoked by MTAs via procmail and what not... sysexits.ph is distributed with Debian and FreeBSD Perl, but not CentOS7. However, the codes are stable across architectures and OSes (AFAIK), unlike syscall numbers.