Skip to content

Commit b37c8a3

Browse files
committed
fix: handle passing in no users or groups
1 parent 020f641 commit b37c8a3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cli/sharing.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ func (r *RootCmd) shareWorkspace(orgContext *OrganizationContext) *serpent.Comma
7070
serpent.RequireRangeArgs(1, -1),
7171
),
7272
Handler: func(inv *serpent.Invocation) error {
73+
if len(users) == 0 && len(groups) == 0 {
74+
return xerrors.New("at least one user or group must be provided")
75+
}
76+
7377
workspace, err := namedWorkspace(inv.Context(), client, inv.Args[0])
7478
if err != nil {
7579
return xerrors.Errorf("could not fetch the workspace %s: %w", inv.Args[0], err)

0 commit comments

Comments
 (0)