From 1813a504d9c59240cd830a6b1259d6f8f511ef96 Mon Sep 17 00:00:00 2001 From: "jrayhawk+piny.be@omgwallhack.org" Date: Fri, 21 Jan 2011 00:36:08 -0800 Subject: Adding noninteractive mode to newrepo --- pinyadmin/sbin/newrepo | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'pinyadmin/sbin/newrepo') diff --git a/pinyadmin/sbin/newrepo b/pinyadmin/sbin/newrepo index a178ecb..1f7f546 100755 --- a/pinyadmin/sbin/newrepo +++ b/pinyadmin/sbin/newrepo @@ -7,7 +7,13 @@ use Moose::Util::TypeConstraints qw( find_type_constraint ); use Piny; -my ( $name ) = @ARGV; +my ( $batch, $name ); + +if ( $ARGV[0] eq "--batch" ) { + ( $batch, $name ) = @ARGV; +} else { + ( $name ) = @ARGV; +}; if ( not defined $name ) { print "Usage: newrepo REPONAME\n"; @@ -27,6 +33,9 @@ while( 1 ) { if ( not find_type_constraint( "SimpleText" )->check( $description ) ) { print "Must be 1-80 characters long; control characters (including tab) not allowed.\n"; + if ( defined $batch ) { + exit; + }; next; }; -- cgit v1.2.3