@@ -26,13 +26,6 @@ import (
2626 "github.com/authzed/zed/internal/console"
2727)
2828
29- const readCmdHelpLong = `Enumerates relationships matching the provided pattern.
30-
31- To filter returned relationships using a resource ID prefix, append a '%' to the resource ID:
32-
33- zed relationship read some-type:some-prefix-%
34- `
35-
3629func RegisterRelationshipCmd (rootCmd * cobra.Command ) * cobra.Command {
3730 relationshipCmd := & cobra.Command {
3831 Use : "relationship <subcommand>" ,
@@ -45,6 +38,10 @@ func RegisterRelationshipCmd(rootCmd *cobra.Command) *cobra.Command {
4538 Args : ValidationWrapper (StdinOrExactArgs (3 )),
4639 ValidArgsFunction : GetArgs (ResourceID , Permission , SubjectTypeWithOptionalRelation ),
4740 RunE : writeRelationshipCmdFunc (v1 .RelationshipUpdate_OPERATION_CREATE , os .Stdin ),
41+ Example : `
42+ zed relationship create document:budget view user:anne --expiration-time "2025-12-31T23:59:59Z"
43+ zed relationship create document:budget view user:anne --caveat ip_address:'{"ip": "192.168.0.1"}
44+ ` ,
4845 }
4946
5047 touchCmd := & cobra.Command {
@@ -53,6 +50,10 @@ func RegisterRelationshipCmd(rootCmd *cobra.Command) *cobra.Command {
5350 Args : ValidationWrapper (StdinOrExactArgs (3 )),
5451 ValidArgsFunction : GetArgs (ResourceID , Permission , SubjectTypeWithOptionalRelation ),
5552 RunE : writeRelationshipCmdFunc (v1 .RelationshipUpdate_OPERATION_TOUCH , os .Stdin ),
53+ Example : `
54+ zed relationship touch document:budget view user:anne --expiration-time "2025-12-31T23:59:59Z"
55+ zed relationship touch document:budget view user:anne --caveat ip_address:'{"ip": "192.168.0.1"}
56+ ` ,
5657 }
5758
5859 deleteCmd := & cobra.Command {
@@ -66,10 +67,13 @@ func RegisterRelationshipCmd(rootCmd *cobra.Command) *cobra.Command {
6667 readCmd := & cobra.Command {
6768 Use : "read <resource_type:optional_resource_id> <optional_relation> <optional_subject_type:optional_subject_id#optional_subject_relation>" ,
6869 Short : "Enumerates relationships matching the provided pattern" ,
69- Long : readCmdHelpLong ,
7070 Args : ValidationWrapper (cobra .RangeArgs (1 , 3 )),
7171 ValidArgsFunction : GetArgs (ResourceID , Permission , SubjectTypeWithOptionalRelation ),
7272 RunE : readRelationships ,
73+ Example : `
74+ # To filter returned relationships using a resource ID prefix, append a '%' to the resource ID.
75+ zed relationship read document:finance-%
76+ ` ,
7377 }
7478
7579 bulkDeleteCmd := & cobra.Command {
0 commit comments