forked from toolshed/abra
		
	fix: make ps a bit more useful and less verbose
This commit is contained in:
		| @ -35,18 +35,22 @@ var appPsCommand = &cli.Command{ | |||||||
| 			logrus.Fatal(err) | 			logrus.Fatal(err) | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		tableCol := []string{"id", "image", "command", "created", "status", "ports", "names"} | 		tableCol := []string{"image", "created", "status", "ports", "names"} | ||||||
| 		table := abraFormatter.CreateTable(tableCol) | 		table := abraFormatter.CreateTable(tableCol) | ||||||
|  |  | ||||||
| 		for _, container := range containers { | 		for _, container := range containers { | ||||||
|  | 			var containerNames []string | ||||||
|  | 			for _, containerName := range container.Names { | ||||||
|  | 				trimmed := strings.TrimPrefix(containerName, "/") | ||||||
|  | 				containerNames = append(containerNames, trimmed) | ||||||
|  | 			} | ||||||
|  |  | ||||||
| 			tableRow := []string{ | 			tableRow := []string{ | ||||||
| 				abraFormatter.ShortenID(container.ID), |  | ||||||
| 				abraFormatter.RemoveSha(container.Image), | 				abraFormatter.RemoveSha(container.Image), | ||||||
| 				abraFormatter.Truncate(container.Command), |  | ||||||
| 				abraFormatter.HumanDuration(container.Created), | 				abraFormatter.HumanDuration(container.Created), | ||||||
| 				container.Status, | 				container.Status, | ||||||
| 				formatter.DisplayablePorts(container.Ports), | 				formatter.DisplayablePorts(container.Ports), | ||||||
| 				strings.Join(container.Names, ", "), | 				strings.Join(containerNames, "\n"), | ||||||
| 			} | 			} | ||||||
| 			table.Append(tableRow) | 			table.Append(tableRow) | ||||||
| 		} | 		} | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user