gitpod/dev/gpctl/cmd/users-block.go
Kyle Brennan 8ca78eabbd
[gpctl] add users unblock command (#19320)
* [gpctl] unblock user command

* [gpctl] refactor blockUser

Ergonomically it is nice to block and unblock as separate commands

But we can consolidate logic to a single function
2024-01-12 22:57:49 +02:00

28 lines
644 B
Go

// Copyright (c) 2020 Gitpod GmbH. All rights reserved.
// Licensed under the GNU Affero General Public License (AGPL).
// See License.AGPL.txt in the project root for license information.
package cmd
import (
"context"
"github.com/spf13/cobra"
)
// usersBlockCmd represents the describe command
var usersBlockCmd = &cobra.Command{
Use: "block <userID> ... <userID>",
Short: "blocks a user",
Args: cobra.MinimumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
blockUser(ctx, args, true)
},
}
func init() {
usersCmd.AddCommand(usersBlockCmd)
}