Exemple #1
0
// ShowStatus shows status info for a service
func ShowStatus(label string, log logger.Logger) error {
	service := NewService(label)
	service.SetLogger(log)
	status, err := service.LoadStatus()
	if err != nil {
		return err
	}
	if status != nil {
		log.Info("%s", status.Description())
	} else {
		log.Info("No service found with label: %s", label)
	}
	return nil
}
Exemple #2
0
// ShowServices outputs keybase service info.
func ShowServices(filters []string, name string, log logger.Logger) (err error) {
	services, err := ListServices(filters)
	if err != nil {
		return
	}
	if len(services) > 0 {
		log.Info("%s %s:", name, libkb.Pluralize(len(services), "service", "services", false))
		for _, service := range services {
			log.Info(service.StatusDescription())
		}
		log.Info("")
	} else {
		log.Info("No %s services.\n", name)
	}
	return
}