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 90091927..272a9e9a 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 c89b8c29..516feffa 100644 --- a/handlers_drive.go +++ b/handlers_drive.go @@ -241,6 +241,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)