Author: dteske
Date: Tue Jan 26 23:59:30 2016
New Revision: 294861
URL: https://svnweb.freebsd.org/changeset/base/294861

Log:
  Add `-k' for dpv(3) `keep_tite' config option
  
  For scripts using dialog(1) several times, it can be visually distracting
  running dpv(1) several times amidst other dialogs. The `-k' option, similar
  to dialog(1) `--keep-tite', enables the same functionality to smooth ti/te.

Modified:
  head/usr.bin/dpv/dpv.1
  head/usr.bin/dpv/dpv.c

Modified: head/usr.bin/dpv/dpv.1
==============================================================================
--- head/usr.bin/dpv/dpv.1      Tue Jan 26 23:56:27 2016        (r294860)
+++ head/usr.bin/dpv/dpv.1      Tue Jan 26 23:59:30 2016        (r294861)
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2013-2015 Devin Teske
+.\" Copyright (c) 2013-2016 Devin Teske
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd Oct 22, 2015
+.Dd Jan 26, 2016
 .Dt DPV 1
 .Os
 .Sh NAME
@@ -138,6 +138,11 @@ Default value
 is
 .Dq Li %'10lli bytes read @ %'9.1f bytes/sec. [%i/%i busy/wait] .
 This format is used when handling more than one file.
+.It Fl k
+Keep tite.
+Prevent visually distracting initialization/exit routines for scripts running
+.Xr dialog 1
+several times.
 .It Fl l
 Line mode. Read lines from input instead of bytes.
 .It Fl L Ar size

Modified: head/usr.bin/dpv/dpv.c
==============================================================================
--- head/usr.bin/dpv/dpv.c      Tue Jan 26 23:56:27 2016        (r294860)
+++ head/usr.bin/dpv/dpv.c      Tue Jan 26 23:59:30 2016        (r294861)
@@ -271,7 +271,7 @@ main(int argc, char *argv[])
         * Process command-line options
         */
        while ((ch = getopt(argc, argv,
-           "a:b:dDhi:I:lL:mn:No:p:P:t:TU:wx:X")) != -1) {
+           "a:b:dDhi:I:klL:mn:No:p:P:t:TU:wx:X")) != -1) {
                switch(ch) {
                case 'a': /* additional message text to append */
                        if (config->aprompt == NULL) {
@@ -307,6 +307,9 @@ main(int argc, char *argv[])
                case 'I': /* status line format string for many-files */
                        config->status_many = optarg;
                        break;
+               case 'k': /* keep tite */
+                       config->keep_tite = TRUE;
+                       break;
                case 'l': /* Line mode */
                        line_mode = TRUE;
                        break;
@@ -467,7 +470,8 @@ main(int argc, char *argv[])
        if (dpv(config, file_list) != 0 && debug)
                warnx("dpv(3) returned error!?");
 
-       end_dialog();
+       if (!config->keep_tite)
+               end_dialog();
        dpv_free();
 
        exit(EXIT_SUCCESS);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to