...

Source file src/flag/export_test.go

Documentation: flag

		 1  // Copyright 2010 The Go Authors. All rights reserved.
		 2  // Use of this source code is governed by a BSD-style
		 3  // license that can be found in the LICENSE file.
		 4  
		 5  package flag
		 6  
		 7  import "os"
		 8  
		 9  // Additional routines compiled into the package only during testing.
		10  
		11  var DefaultUsage = Usage
		12  
		13  // ResetForTesting clears all flag state and sets the usage function as directed.
		14  // After calling ResetForTesting, parse errors in flag handling will not
		15  // exit the program.
		16  func ResetForTesting(usage func()) {
		17  	CommandLine = NewFlagSet(os.Args[0], ContinueOnError)
		18  	CommandLine.Usage = commandLineUsage
		19  	Usage = usage
		20  }
		21  

View as plain text