~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/github.com/lxc/lxd/shared/gnuflag/export_test.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 gnuflag
 
6
 
 
7
import (
 
8
        "os"
 
9
)
 
10
 
 
11
// Additional routines compiled into the package only during testing.
 
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
        Usage = usage
 
19
}
 
20
 
 
21
// CommandLine returns the default FlagSet.
 
22
func CommandLine() *FlagSet {
 
23
        return commandLine
 
24
}