Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

add the parameter to specify the Google Apps domain when the sharing type is domain #190

Merged
merged 1 commit into from
Sep 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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