Path: blob/main/components/gitpod-cli/cmd/completion.go
2498 views
// Copyright (c) 2020 Gitpod GmbH. All rights reserved.1// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34package cmd56import (7"os"89"github.com/gitpod-io/gitpod/gitpod-cli/pkg/utils"10"github.com/spf13/cobra"11)1213// completionCmd represents the completion command14var completionCmd = &cobra.Command{15Use: "completion",16Hidden: true,17Short: "Generates bash completion scripts",18Long: `To load completion run1920. <(gp completion)2122To configure your bash shell to load completions for each session add to your bashrc2324# ~/.bashrc or ~/.profile25. <(gp completion)26`,27RunE: func(cmd *cobra.Command, args []string) error {28// ignore trace29utils.TrackCommandUsageEvent.Command = nil3031_ = rootCmd.GenBashCompletion(os.Stdout)32return nil33},34}3536func init() {37rootCmd.AddCommand(completionCmd)38}394041