Ejemplo n.º 1
0
func (s *CmdTestSuite) TestAddOptionDescriptionOrPanicWillPanic(c *C) {
	// disable logging so log doesn't scare people
	logger.SetLogger(logger.NullLogger)
	defer func() { c.Check(logger.SimpleSetup(), IsNil) }()

	parser := flags.NewParser(&struct{}{}, 0)
	arg, err := parser.AddCommand("mock", "shortHelp", "longHelp", &struct{}{})
	c.Assert(err, IsNil)
	f := func() {
		addOptionDescription(arg, "package name", "pkgname description")
	}
	c.Assert(f, PanicMatches, "can not set option description for \"package name\"")
}
Ejemplo n.º 2
0
func init() {
	err := logger.SimpleSetup()
	if err != nil {
		fmt.Fprintf(Stderr, "WARNING: failed to activate logging: %s\n", err)
	}
}