From 41ce2f5b472cb4caf14b8814a43b22eb6d2da9e4 Mon Sep 17 00:00:00 2001 From: Fabio Di Fabio Date: Thu, 1 Sep 2016 16:07:28 +0200 Subject: [PATCH] add the parameter to specify the Google Apps domain when the sharing type is domain --- drive/share.go | 2 ++ gdrive.go | 5 +++++ handlers_drive.go | 1 + 3 files changed, 8 insertions(+) diff --git a/drive/share.go b/drive/share.go index 69b9c7d8..e942c170 100644 --- a/drive/share.go +++ b/drive/share.go @@ -13,6 +13,7 @@ type ShareArgs struct { Role string Type string Email string + Domain string Discoverable bool } @@ -22,6 +23,7 @@ func (self *Drive) Share(args ShareArgs) error { Role: args.Role, Type: args.Type, EmailAddress: args.Email, + Domain: args.Domain, } _, err := self.service.Permissions.Create(args.FileId, permission).Do() diff --git a/gdrive.go b/gdrive.go index ecb69503..b6078278 100644 --- a/gdrive.go +++ b/gdrive.go @@ -380,6 +380,11 @@ func main() { Patterns: []string{"--email"}, Description: "The email address of the user or group to share the file with. Requires 'user' or 'group' as type", }, + cli.StringFlag{ + Name: "domain", + Patterns: []string{"--domain"}, + Description: "The name of Google Apps domain. Requires 'domain' as type", + }, cli.BoolFlag{ Name: "discoverable", Patterns: []string{"--discoverable"}, diff --git a/handlers_drive.go b/handlers_drive.go index 8db7329b..07c12d47 100644 --- a/handlers_drive.go +++ b/handlers_drive.go @@ -240,6 +240,7 @@ func shareHandler(ctx cli.Context) { Role: args.String("role"), Type: args.String("type"), Email: args.String("email"), + Domain: args.String("domain"), Discoverable: args.Bool("discoverable"), }) checkErr(err)