aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/git-lfs-authenticate/main.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd/git-lfs-authenticate/main.go b/cmd/git-lfs-authenticate/main.go
index dd39606..5a5b760 100644
--- a/cmd/git-lfs-authenticate/main.go
+++ b/cmd/git-lfs-authenticate/main.go
@@ -106,6 +106,8 @@ func wipe(b []byte) {
106 } 106 }
107} 107}
108 108
109const usage = "Usage: git-lfs-authenticate <REPO> <OPERATION (upload/download)>"
110
109func main() { 111func main() {
110 // Even though not explicitly described in the Git LFS documentation, the 112 // Even though not explicitly described in the Git LFS documentation, the
111 // git-lfs-authenticate command is expected to either exit succesfully with 113 // git-lfs-authenticate command is expected to either exit succesfully with
@@ -118,13 +120,13 @@ func main() {
118 logger := newLogger(reqID) 120 logger := newLogger(reqID)
119 121
120 if len(os.Args) != 3 { 122 if len(os.Args) != 3 {
121 die("expected 2 arguments (path, operation), got %d", len(os.Args)-1) 123 die(usage)
122 } 124 }
123 125
124 repo := strings.TrimPrefix(strings.TrimSuffix(os.Args[1], ".git"), "/") 126 repo := strings.TrimPrefix(strings.TrimSuffix(os.Args[1], ".git"), "/")
125 operation := os.Args[2] 127 operation := os.Args[2]
126 if operation != "download" && operation != "upload" { 128 if operation != "download" && operation != "upload" {
127 die("expected operation to be upload or download, got %s", operation) 129 die(usage)
128 } 130 }
129 131
130 repoHRefBaseStr := os.Getenv("REPO_HREF_BASE") 132 repoHRefBaseStr := os.Getenv("REPO_HREF_BASE")