Skip to content

Commit

Permalink
add the parameter to specify the Google Apps domain when the sharing …
Browse files Browse the repository at this point in the history
…type is domain
  • Loading branch information
fab-io committed Sep 1, 2016
1 parent 5f32135 commit 41ce2f5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drive/share.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type ShareArgs struct {
Role string
Type string
Email string
Domain string
Discoverable bool
}

Expand All @@ -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()
Expand Down
5 changes: 5 additions & 0 deletions gdrive.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
1 change: 1 addition & 0 deletions handlers_drive.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 41ce2f5

Please sign in to comment.