summaryrefslogtreecommitdiff
path: root/usr/src/pinyadmin/bin/pinyconfig
diff options
context:
space:
mode:
authorJulian Blake Kongslie <jblake@omgwallhack.org>2010-10-13 10:29:26 -0700
committerJulian Blake Kongslie <jblake@omgwallhack.org>2010-10-13 10:29:26 -0700
commit77a280d36dfa31d6bcc95f6469800c1c5a20d29d (patch)
treea90207bf1f024f74cb8c0103bc6c0d09354f2940 /usr/src/pinyadmin/bin/pinyconfig
parentbf8d666416764c16e4be19fbef0f21c2a644f749 (diff)
downloadpiny-code-77a280d36dfa31d6bcc95f6469800c1c5a20d29d.tar.gz
piny-code-77a280d36dfa31d6bcc95f6469800c1c5a20d29d.zip
Documentation.
Diffstat (limited to 'usr/src/pinyadmin/bin/pinyconfig')
-rwxr-xr-xusr/src/pinyadmin/bin/pinyconfig20
1 files changed, 18 insertions, 2 deletions
diff --git a/usr/src/pinyadmin/bin/pinyconfig b/usr/src/pinyadmin/bin/pinyconfig
index ec8e80a..e18ac30 100755
--- a/usr/src/pinyadmin/bin/pinyconfig
+++ b/usr/src/pinyadmin/bin/pinyconfig
@@ -7,12 +7,28 @@ use Piny;
my ( $reponame, $attr, $value ) = @ARGV;
+if ( not defined $reponame or not defined $attr ) {
+ die "Usage: $0 reponame tweakable [value]\n";
+};
+
$attr =~ s/\./_/g;
my $repo = Piny::Repo->new( $reponame );
if ( defined $value ) {
- $repo->config->$attr( $value );
+ undef $@;
+ eval {
+ $repo->config->$attr( $value );
+ };
+ if ( defined $@ ) {
+ print STDERR "$attr is not a legal tweakable, or $value is not a legal value for that tweakable.\n$@\n";
+ };
};
-print "$attr = " . $repo->config->$attr . "\n";
+undef $@;
+eval {
+ print "$attr = " . $repo->config->$attr . "\n";
+};
+if ( defined $@ ) {
+ print STDERR "$attr is not a legal tweakable, or its current value is illegal.\n$@\n";
+};