// Build a little status bar for debug and ./toolbelt -l purposes func StatusBar(s *session.Session, title string) (bar string) { bar = " " + title + ":" BARSIZE := 100 - len(title) i := int(BARSIZE * s.GetState() / s.GetLimit()) j := BARSIZE - i for i+j > 0 { if i > 0 { i-- bar += "*" } else { j-- bar += "-" } } bar += utils.IntToString(s.GetState()) + "/" + utils.IntToString(s.GetLimit()) return }