mirror of
https://github.com/docker/compose.git
synced 2026-08-27 03:45:29 +00:00
Add json output format to several commands
- docker context ls - docker ps - docker compose ls - docker compose ps - docker secret ls - docker volume ls - docker version Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
This commit is contained in:
parent
abd6af6386
commit
8961805412
23 changed files with 665 additions and 118 deletions
|
|
@ -112,7 +112,10 @@ func IsDefaultContextCommand(dockerCommand string) bool {
|
|||
}
|
||||
|
||||
// ExecSilent executes a command and do redirect output to stdOut, return output
|
||||
func ExecSilent(ctx context.Context) ([]byte, error) {
|
||||
cmd := exec.CommandContext(ctx, ComDockerCli, os.Args[1:]...)
|
||||
func ExecSilent(ctx context.Context, args ...string) ([]byte, error) {
|
||||
if len(args) == 0 {
|
||||
args = os.Args[1:]
|
||||
}
|
||||
cmd := exec.CommandContext(ctx, ComDockerCli, args...)
|
||||
return cmd.CombinedOutput()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue