statzone

DNS zone file analyzer targeted at TLD zones
Log | Files | Refs | README | LICENSE

commit b8ef5510af50d8dd6c20921cbf5fc98ea342b36f
parent 08ab489ff6fe560053063d68ea34c58d5153ebe9
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date:   Sun,  9 Aug 2015 13:35:38 +0200

Check input parameters and show usage if no input file is specified

Diffstat:
Mstatzone.go | 17++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/statzone.go b/statzone.go @@ -4,7 +4,7 @@ /* http://www.statdns.com */ /* */ /* Created: 2012/02/13 */ -/* Last Updated: 2015/08/02 */ +/* Last Updated: 2015/08/09 */ /* */ /* StatZone is released under the BSD 3-Clause license. */ /* See LICENSE file for details. */ @@ -30,7 +30,7 @@ type Domains struct { var rrParsed int -// Return rdata +/* Return rdata */ func rdata(RR dns.RR) string { return strings.Replace(RR.String(), RR.Header().String(), "", -1) } @@ -40,11 +40,18 @@ func main() { StatZone (c) by Frederic Cambus 2012-2015 -------------------------------------------------------------------------------` - inputFile := os.Args[1] + fmt.Println(header + "\n") + + /* Check input parameters and show usage */ + if len(os.Args) != 2 { + fmt.Println("USAGE: statzone inputfile\n") + fmt.Println("EXAMPLES: statzone arpa.zone\n") + os.Exit(1) + } - fmt.Println(header) + inputFile := os.Args[1] - fmt.Println("\nParsing zone :", inputFile) + fmt.Println("Parsing zone :", inputFile) domains := new(Domains)