mirror of
https://github.com/gitpod-io/gitpod.git
synced 2025-12-08 17:36:30 +00:00
* [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
28 lines
655 B
Go
28 lines
655 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"
|
|
)
|
|
|
|
// usersUnblockCmd represents the describe command
|
|
var usersUnblockCmd = &cobra.Command{
|
|
Use: "unblock <userID> ... <userID>",
|
|
Short: "unblocks a user",
|
|
Args: cobra.MinimumNArgs(1),
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
ctx, cancel := context.WithCancel(context.Background())
|
|
defer cancel()
|
|
blockUser(ctx, args, false)
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
usersCmd.AddCommand(usersUnblockCmd)
|
|
}
|