diff options
author | Julian Blake Kongslie <jblake@omgwallhack.org> | 2010-10-13 10:29:26 -0700 |
---|---|---|
committer | Julian Blake Kongslie <jblake@omgwallhack.org> | 2010-10-13 10:29:26 -0700 |
commit | 77a280d36dfa31d6bcc95f6469800c1c5a20d29d (patch) | |
tree | a90207bf1f024f74cb8c0103bc6c0d09354f2940 /usr/src | |
parent | bf8d666416764c16e4be19fbef0f21c2a644f749 (diff) | |
download | piny-code-77a280d36dfa31d6bcc95f6469800c1c5a20d29d.tar.gz piny-code-77a280d36dfa31d6bcc95f6469800c1c5a20d29d.zip |
Documentation.
Diffstat (limited to 'usr/src')
-rwxr-xr-x | usr/src/pinyadmin/bin/pinyconfig | 20 | ||||
-rw-r--r-- | usr/src/pinyadmin/doc/pinyconfig.latex | 17 |
2 files changed, 35 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"; +}; diff --git a/usr/src/pinyadmin/doc/pinyconfig.latex b/usr/src/pinyadmin/doc/pinyconfig.latex new file mode 100644 index 0000000..4908dbb --- /dev/null +++ b/usr/src/pinyadmin/doc/pinyconfig.latex @@ -0,0 +1,17 @@ +\usepackage{latex2man} + +\begin{Name}{1piny}{pinyconfig}{Piny Team}{Piny}{pinyconfig} + +\Prog{pinyconfig} - change tweakables on a repo + +\section{Synopsis} + +\Prog{pinyconfig} \Arg{reponame} \Arg{tweakable} \oArg{value} + +\section{Description} + +The \Prog{pinyconfig} command reads and writes tweakables for a repo. + +When run, it prints the value of the tweakable for the repo named. +If a value was passed, it sets the value of the tweakable to that value +before printing it. |