b10-dbutil \- Zone Database Maintenance Utility
.SH "SYNOPSIS"
.HP \w'\fBb10\-dbutil\ \-\-check\fR\ 'u
-\fBb10\-dbutil \-\-check\fR [\-\-verbose] [\fIdbfile\fR]
+\fBb10\-dbutil \-\-check\fR [\-\-verbose] [\-\-quiet] [\fIdbfile\fR]
.HP \w'\fBb10\-dbutil\ \-\-upgrade\fR\ 'u
-\fBb10\-dbutil \-\-upgrade\fR [\-\-noconfirm] [\-\-verbose] [\fIdbfile\fR]
+\fBb10\-dbutil \-\-upgrade\fR [\-\-noconfirm] [\-\-verbose] [\-\-quiet] [\fIdbfile\fR]
.SH "DESCRIPTION"
.PP
The
Enable verbose mode\&. Each SQL command issued by the utility will be printed to stdout before it is executed\&.
.RE
.PP
+\fB\-\-quiet\fR
+.RS 4
+Enable quiet mode\&. No output is printed, except errors during command\-line argument parsing, or the user confirmation dialog\&.
+.RE
+.PP
\fB\fIdbfile\fR\fR
.RS 4
Name of the database file to check of upgrade\&.
<cmdsynopsis>
<command>b10-dbutil --check</command>
<arg>--verbose</arg>
+ <arg>--quiet</arg>
<arg><replaceable choice='req'>dbfile</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>b10-dbutil --upgrade</command>
<arg>--noconfirm</arg>
<arg>--verbose</arg>
+ <arg>--quiet</arg>
<arg><replaceable choice='req'>dbfile</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>
+ <option>--quiet</option>
+ </term>
+ <listitem>
+ <para>Enable quiet mode. No output is printed, except errors during
+ command-line argument parsing, or the user confirmation dialog.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term>
<option><replaceable choice='req'>dbfile</replaceable></option>
parser.add_option("-v", "--verbose", action="store_true",
dest="verbose", default=False,
help="Print SQL statements as they are executed")
+ parser.add_option("-q", "--quiet", action="store_true",
+ dest="quiet", default=False,
+ help="Don't print any info, warnings or errors")
(options, args) = parser.parse_args()
# Set the database file on which to operate
if options.verbose:
isc.log.init("b10-dbutil", "DEBUG", 99)
logger = isc.log.Logger("dbutil")
+ elif options.quiet:
+ # We don't use FATAL, so setting the logger to use
+ # it should essentially make it silent.
+ isc.log.init("b10-dbutil", "FATAL")
+ logger = isc.log.Logger("dbutil")
db = Database(args[0])
exit_code = EXIT_SUCCESS
passzero $?
rm -f $tempfile $backupfile
+echo "13.3 quiet flag"
+copy_file $testdata/old_v1.sqlite3 $tempfile
+../run_dbutil.sh --check --quiet $tempfile 2>&1 | grep dbutil
+failzero $?
+rm -f $tempfile $backupfile
+
echo "13.3 Interactive prompt - yes"
copy_file $testdata/old_v1.sqlite3 $tempfile
../run_dbutil.sh --upgrade $tempfile << .