@@ -12,6 +12,7 @@ import (
1212 "google.golang.org/api/googleapi"
1313)
1414
15+ // Version is inject at build time
1516var Version = "0.0.0"
1617var helpTemplate = `NAME:
1718{{.Name}} - {{.Usage}}
@@ -282,14 +283,16 @@ var globalFlags = []cli.Flag{
282283 },
283284}
284285
286+ // Cmd wraps cli.app
285287type Cmd struct {
286288 * cli.App
287289}
288290
289- func VersionAction (c * cli.Context ) {
291+ func versionAction (c * cli.Context ) {
290292 fmt .Println (color .YellowString (fmt .Sprintf ("transfer.sh %s: Easy file sharing from the command line" , Version )))
291293}
292294
295+ // New is the factory for transfer.sh
293296func New () * Cmd {
294297 logger := log .New (os .Stdout , "[transfer.sh]" , log .LstdFlags )
295298
@@ -304,7 +307,7 @@ func New() *Cmd {
304307 app .Commands = []cli.Command {
305308 {
306309 Name : "version" ,
307- Action : VersionAction ,
310+ Action : versionAction ,
308311 },
309312 }
310313
@@ -403,13 +406,13 @@ func New() *Cmd {
403406 }
404407
405408 if c .Bool ("force-https" ) {
406- options = append (options , server .ForceHTTPs ())
409+ options = append (options , server .ForceHTTPS ())
407410 }
408411
409412 if httpAuthUser := c .String ("http-auth-user" ); httpAuthUser == "" {
410413 } else if httpAuthPass := c .String ("http-auth-pass" ); httpAuthPass == "" {
411414 } else {
412- options = append (options , server .HttpAuthCredentials (httpAuthUser , httpAuthPass ))
415+ options = append (options , server .HTTPAuthCredentials (httpAuthUser , httpAuthPass ))
413416 }
414417
415418 applyIPFilter := false
@@ -445,13 +448,13 @@ func New() *Cmd {
445448 case "gdrive" :
446449 chunkSize := c .Int ("gdrive-chunk-size" )
447450
448- if clientJsonFilepath := c .String ("gdrive-client-json-filepath" ); clientJsonFilepath == "" {
451+ if clientJSONFilepath := c .String ("gdrive-client-json-filepath" ); clientJSONFilepath == "" {
449452 panic ("client-json-filepath not set." )
450453 } else if localConfigPath := c .String ("gdrive-local-config-path" ); localConfigPath == "" {
451454 panic ("local-config-path not set." )
452455 } else if basedir := c .String ("basedir" ); basedir == "" {
453456 panic ("basedir not set." )
454- } else if storage , err := server .NewGDriveStorage (clientJsonFilepath , localConfigPath , basedir , chunkSize , logger ); err != nil {
457+ } else if storage , err := server .NewGDriveStorage (clientJSONFilepath , localConfigPath , basedir , chunkSize , logger ); err != nil {
455458 panic (err )
456459 } else {
457460 options = append (options , server .UseStorage (storage ))
0 commit comments