Skip to content

Commit d93086b

Browse files
Merge pull request #262 from dropbox/share-link-help-text
Add long descriptions and examples to share-link commands
2 parents 622a304 + 3b26897 commit d93086b

6 files changed

Lines changed: 30 additions & 6 deletions

File tree

cmd/share-list-links.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,11 @@ func sharedLinkMetadataDisplay(sl sharing.SharedLinkMetadata) (name string, url
119119
var shareLinkListCmd = &cobra.Command{
120120
Use: "list [path]",
121121
Short: "List shared links",
122-
RunE: shareLinkList,
122+
Long: `List shared links.
123+
When path is supplied, dbxcli lists direct shared links for that Dropbox path only.`,
124+
Example: ` dbxcli share-link list
125+
dbxcli share-link list /file.txt`,
126+
RunE: shareLinkList,
123127
}
124128

125129
var shareListLinksCmd = &cobra.Command{

cmd/share_link.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ var newSharedLinkClient = func(cfg dropbox.Config) sharedLinkClient {
4848
var shareLinkCmd = &cobra.Command{
4949
Use: "share-link",
5050
Short: "Shared link commands",
51+
Long: "Create, list, inspect, download, update, and revoke Dropbox shared links.",
5152
}
5253

5354
func init() {

cmd/share_link_create.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,15 @@ func linkAudience(tag string) *sharing.LinkAudience {
416416
var shareLinkCreateCmd = &cobra.Command{
417417
Use: "create <path>",
418418
Short: "Create a shared link",
419-
RunE: shareLinkCreate,
419+
Long: `Create a shared link for a Dropbox file or folder.
420+
If a direct shared link already exists, dbxcli returns that existing URL.
421+
Settings flags request Dropbox shared-link settings; account, team, and folder policies may still restrict the result.`,
422+
Example: ` dbxcli share-link create /file.txt
423+
dbxcli share-link create /folder
424+
dbxcli share-link create /file.txt --audience team
425+
dbxcli share-link create /file.txt --expires 2026-07-01T00:00:00Z
426+
dbxcli share-link create /file.txt --password-prompt`,
427+
RunE: shareLinkCreate,
420428
}
421429

422430
func init() {

cmd/share_link_download.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,8 @@ func sharedLinkDownloadSize(link sharing.IsSharedLinkMetadata) uint64 {
498498

499499
var shareLinkDownloadCmd = &cobra.Command{
500500
Use: "download <url> [target]",
501-
Short: "Download a shared link file",
502-
Long: `Download a file from a Dropbox shared link.
501+
Short: "Download shared link content",
502+
Long: `Download content from a Dropbox shared link.
503503
- If target is omitted, the local filename comes from shared-link metadata.
504504
- Use --path to download a file inside a folder shared link.
505505
- Use - as target to write file bytes to stdout.

cmd/share_link_info.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ func sharedLinkBaseMetadata(link sharing.IsSharedLinkMetadata) (*sharing.SharedL
155155
var shareLinkInfoCmd = &cobra.Command{
156156
Use: "info <url>",
157157
Short: "Display shared link information",
158-
RunE: shareLinkInfo,
158+
Long: `Display metadata and permissions for a shared link.
159+
Use --path to inspect a file or folder inside a folder shared link.`,
160+
Example: ` dbxcli share-link info https://www.dropbox.com/s/example/file.txt
161+
dbxcli share-link info https://www.dropbox.com/s/example/folder --path /nested/file.txt`,
162+
RunE: shareLinkInfo,
159163
}
160164

161165
func init() {

cmd/share_link_update.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,14 @@ func rawSharedLinkSettingsFromUpdateOptions(opts shareLinkUpdateOptions) *rawSha
187187
var shareLinkUpdateCmd = &cobra.Command{
188188
Use: "update <url>",
189189
Short: "Update shared link settings",
190-
RunE: shareLinkUpdate,
190+
Long: `Update settings for an existing shared link.
191+
At least one setting flag is required. Dropbox account, team, and folder policies may reject or constrain requested settings.`,
192+
Example: ` dbxcli share-link update https://www.dropbox.com/s/example/file.txt --audience team
193+
dbxcli share-link update https://www.dropbox.com/s/example/file.txt --expires 2026-07-01T00:00:00Z
194+
dbxcli share-link update https://www.dropbox.com/s/example/file.txt --remove-expiration
195+
dbxcli share-link update https://www.dropbox.com/s/example/file.txt --password-prompt
196+
dbxcli share-link update https://www.dropbox.com/s/example/file.txt --remove-password`,
197+
RunE: shareLinkUpdate,
191198
}
192199

193200
func init() {

0 commit comments

Comments
 (0)