github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/cli/scripts/docs/generate-man.sh (about)

     1  #!/usr/bin/env bash
     2  # Generate man pages for docker/cli
     3  set -eu -o pipefail
     4  
     5  mkdir -p ./man/man1
     6  
     7  if ! command -v go-md2man &> /dev/null; then
     8  	# yay, go install creates a binary named "v2" ¯\_(ツ)_/¯
     9  	go build -o "/go/bin/go-md2man" ./vendor/github.com/cpuguy83/go-md2man/v2
    10  fi
    11  
    12  # Generate man pages from cobra commands
    13  go build -o /tmp/gen-manpages github.com/docker/cli/man
    14  /tmp/gen-manpages --root "$(pwd)" --target "$(pwd)/man/man1"
    15  
    16  # Generate legacy pages from markdown
    17  ./man/md2man-all.sh -q