From owner-freebsd-bugs Thu Dec 31 19:50:10 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA26169 for freebsd-bugs-outgoing; Thu, 31 Dec 1998 19:50:10 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA26161 for ; Thu, 31 Dec 1998 19:50:09 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id TAA14372; Thu, 31 Dec 1998 19:50:01 -0800 (PST) Received: from gaylord.async.vt.edu (gaylord.async.vt.edu [128.173.18.131]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA25983 for ; Thu, 31 Dec 1998 19:46:19 -0800 (PST) (envelope-from toor@gaylord.async.vt.edu) Received: (from root@localhost) by gaylord.async.vt.edu (8.9.1/8.9.1) id WAA58228; Thu, 31 Dec 1998 22:48:19 -0500 (EST) (envelope-from toor) Message-Id: <199901010348.WAA58228@gaylord.async.vt.edu> Date: Thu, 31 Dec 1998 22:48:19 -0500 (EST) From: cgaylord@vt.edu Reply-To: cgaylord@vt.edu To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/9259: Adding -y to fdformat for autoyes Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 9259 >Category: bin >Synopsis: allow no prompt for yes in fdformat, but still show progress >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Dec 31 19:50:01 PST 1998 >Last-Modified: >Originator: Clark Gaylord >Organization: Virginia Tech >Release: FreeBSD 3.0-CURRENT i386 >Environment: FreeBSD gaylord.async.vt.edu 3.0-CURRENT FreeBSD 3.0-CURRENT #2: Sun Dec 13 21:24:29 EST 1998 toor@gaylord.async.vt.edu:/big/FreeBSD-current/src/sys/compile/BADGER i386 >Description: fdformat -q both gives no feedback and requires no input; proposed change provides more granularity by allowing no input while still providing feedback. >How-To-Repeat: N/A >Fix: Following diffs to fdformat.c and fdformat.1 seem to work. ===== fdformat.c.diff ===== *** fdformat.c.orig Thu Dec 31 21:12:46 1998 --- fdformat.c Thu Dec 31 21:23:59 1998 *************** *** 138,144 **** usage (void) { fprintf(stderr, "%s\n%s\n", ! "usage: fdformat [-q] [-n | -v] [-f #] [-c #] [-s #] [-h #]", " [-r #] [-g #] [-i #] [-S #] [-F #] [-t #] devname"); exit(2); } --- 138,144 ---- usage (void) { fprintf(stderr, "%s\n%s\n", ! "usage: fdformat [-y] [-q] [-n | -v] [-f #] [-c #] [-s #] [-h #]", " [-r #] [-g #] [-i #] [-S #] [-F #] [-t #] devname"); exit(2); } *************** *** 168,179 **** { int format = -1, cyls = -1, secs = -1, heads = -1, intleave = -1; int rate = -1, gaplen = -1, secsize = -1, steps = -1; ! int fill = 0xf6, quiet = 0, verify = 1, verify_only = 0; int fd, c, track, error, tracks_per_dot, bytes_per_track, errs; const char *devname, *suffix; struct fd_type fdt; ! while((c = getopt(argc, argv, "f:c:s:h:r:g:S:F:t:i:qvn")) != -1) switch(c) { case 'f': /* format in kilobytes */ format = atoi(optarg); --- 168,179 ---- { int format = -1, cyls = -1, secs = -1, heads = -1, intleave = -1; int rate = -1, gaplen = -1, secsize = -1, steps = -1; ! int fill = 0xf6, quiet = 0, verify = 1, verify_only = 0, confirm = 0; int fd, c, track, error, tracks_per_dot, bytes_per_track, errs; const char *devname, *suffix; struct fd_type fdt; ! while((c = getopt(argc, argv, "f:c:s:h:r:g:S:F:t:i:qyvn")) != -1) switch(c) { case 'f': /* format in kilobytes */ format = atoi(optarg); *************** *** 219,224 **** --- 219,228 ---- quiet = 1; break; + case 'y': + confirm = 1; + break; + case 'n': verify = 0; break; *************** *** 285,291 **** fdt.tracks * fdt.heads * bytes_per_track / 1024, devname); } ! else if(!quiet) { printf("Format %dK floppy `%s'? (y/n): ", fdt.tracks * fdt.heads * bytes_per_track / 1024, devname); --- 289,295 ---- fdt.tracks * fdt.heads * bytes_per_track / 1024, devname); } ! else if(!quiet && !confirm) { printf("Format %dK floppy `%s'? (y/n): ", fdt.tracks * fdt.heads * bytes_per_track / 1024, devname); ===== fdformat.1.diff ===== *** fdformat.1.orig Thu Dec 31 21:47:34 1998 --- fdformat.1 Thu Dec 31 21:52:38 1998 *************** *** 31,36 **** --- 31,37 ---- .Sh SYNOPSIS .Nm fdformat .Op Fl q + .Op Fl y .Op Fl v | Fl n .Op Fl f Ar capacity .Op Fl c Ar cyls *************** *** 71,76 **** --- 72,80 ---- Suppress any normal output from the command, and don't ask the user for a confirmation whether to format the floppy disk at .Ar device_name . + .It Fl y + Suppress confirmation request by automagically responding "yes", but still + report format status. .It Fl f Ar capacity The normal way to specify the desired formatting parameters. .Ar Capacity >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message