git_clone.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package git
  2. import (
  3. "fmt"
  4. "github.com/docopt/docopt-go"
  5. )
  6. func main() {
  7. usage := `usage: git clone [options] [--] <repo> [<dir>]
  8. options:
  9. -v, --verbose be more verbose
  10. -q, --quiet be more quiet
  11. --progress force progress reporting
  12. -n, --no-checkout don't create a checkout
  13. --bare create a bare repository
  14. --mirror create a mirror repository (implies bare)
  15. -l, --local to clone from a local repository
  16. --no-hardlinks don't use local hardlinks, always copy
  17. -s, --shared setup as shared repository
  18. --recursive initialize submodules in the clone
  19. --recurse-submodules initialize submodules in the clone
  20. --template <template-directory>
  21. directory from which templates will be used
  22. --reference <repo> reference repository
  23. -o, --origin <branch>
  24. use <branch> instead of 'origin' to track upstream
  25. -b, --branch <branch>
  26. checkout <branch> instead of the remote's HEAD
  27. -u, --upload-pack <path>
  28. path to git-upload-pack on the remote
  29. --depth <depth> create a shallow clone of that depth
  30. `
  31. args, _ := docopt.Parse(usage, nil, true, "", false)
  32. fmt.Println(args)
  33. }