From owner-freebsd-bugs Tue Aug 11 19:50:20 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA03239 for freebsd-bugs-outgoing; Tue, 11 Aug 1998 19:50:20 -0700 (PDT) (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 TAA03214 for ; Tue, 11 Aug 1998 19:50:05 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id TAA11870; Tue, 11 Aug 1998 19:50:01 -0700 (PDT) Received: from tick.ssec.wisc.edu (tick.ssec.wisc.edu [144.92.108.121]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA02090 for ; Tue, 11 Aug 1998 19:43:17 -0700 (PDT) (envelope-from dglo@tick.ssec.wisc.edu) Received: from tick.ssec.wisc.edu (localhost [127.0.0.1]) by tick.ssec.wisc.edu (8.8.7/8.8.7) with ESMTP id VAA21912 for ; Tue, 11 Aug 1998 21:42:53 -0500 (CDT) Message-Id: <199808120242.VAA21912@tick.ssec.wisc.edu> Date: Tue, 11 Aug 1998 21:42:52 -0500 From: Dave Glowacki To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/7583: indent(1) input file isn't really optional Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 7583 >Category: bin >Synopsis: indent input file argument isn't really optional >Confidential: yes >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Aug 11 19:50:01 PDT 1998 >Last-Modified: >Originator: Dave Glowacki >Organization: >Release: FreeBSD 2.2.6-STABLE i386 >Environment: >Description: The synopsis for indent(1) starts out: indent [input-file [output-file]] [-bad | -nbad] [-bap | -nbap] but when indent is run as 'indent < infile > outfile', it spits out usage: indent file [ outfile ] [ options ] >How-To-Repeat: Run indent >Fix: The CVS log didn't indicate any reason *not* to support input via standard input and I made the following patch without any apparent ill effects (though I didn't really test it exhaustively) Index: indent.c =================================================================== RCS file: /disk0/freebsd/src/usr.bin/indent/indent.c,v retrieving revision 1.1.1.1.8.1 diff -c -r1.1.1.1.8.1 indent.c *** indent.c 1997/07/16 06:41:29 1.1.1.1.8.1 --- indent.c 1998/08/11 23:16:50 *************** *** 209,218 **** set_option(argv[i]); } /* end of for */ if (input == 0) { ! usage(); } if (output == 0) ! if (troff) output = stdout; else { out_name = in_name; --- 209,218 ---- set_option(argv[i]); } /* end of for */ if (input == 0) { ! input = stdin; } if (output == 0) ! if (troff || input == stdin) output = stdout; else { out_name = in_name; *************** *** 1133,1139 **** static void usage() { ! fprintf(stderr, "usage: indent file [ outfile ] [ options ]\n"); exit(1); } --- 1133,1139 ---- static void usage() { ! fprintf(stderr, "usage: indent [ file [ outfile ] ] [ options ]\n"); exit(1); } >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message