[Pkg-privacy-commits] [msva-perl] 279/356: more cleanup of the usage function to make it easier to edit, and maybe invoke elsewhere.

Ximin Luo infinity0 at moszumanska.debian.org
Mon Aug 24 07:42:05 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch debian
in repository msva-perl.

commit d0b1f4100d29ddbff9e23054b6d8926d86a11efc
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date:   Thu Dec 30 17:05:25 2010 -0500

    more cleanup of the usage function to make it easier to edit, and maybe invoke elsewhere.
---
 msva-query-agent | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/msva-query-agent b/msva-query-agent
index ef8a2d4..be08531 100755
--- a/msva-query-agent
+++ b/msva-query-agent
@@ -21,13 +21,20 @@ use strict;
 
 use Crypt::Monkeysphere::MSVA::Client;
 
+sub usage {
+  my $name = shift;
+
+  printf STDERR ("Usage: %s CONTEXT PEER PKC_TYPE [PEER_TYPE] < PKC_DATA
+       %s CONTEXT PEER PKC_TYPE PEER_TYPE PKC_DATA
+       %s --version
+", $name, $name, $name);
+}
+
 my $context = shift;
 if ((!defined($context)) ||
     $context eq '--help') {
-  printf STDERR "Usage: msva-query-agent CONTEXT PEER PKC_TYPE [PEER_TYPE] <PKC_DATA\n";
-  printf STDERR "       msva-query-agent CONTEXT PEER PKC_TYPE PEER_TYPE PKC_DATA\n";
-  printf STDERR "       msva-query-agent --version\n";
-  exit 0;
+  usage($0);
+  exit (defined($context) ? 0 : 1);
 } elsif ($context eq '--version') {
   my $client = Crypt::Monkeysphere::MSVA::Client->new(
 						      socket => $ENV{MONKEYSPHERE_VALIDATION_AGENT_SOCKET},

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/msva-perl.git



More information about the Pkg-privacy-commits mailing list