github.com/andrewhsu/cli/v2@v2.0.1-0.20210910131313-d4b4061f5b89/pkg/cmd/auth/auth.go (about)

     1  package auth
     2  
     3  import (
     4  	gitCredentialCmd "github.com/andrewhsu/cli/v2/pkg/cmd/auth/gitcredential"
     5  	authLoginCmd "github.com/andrewhsu/cli/v2/pkg/cmd/auth/login"
     6  	authLogoutCmd "github.com/andrewhsu/cli/v2/pkg/cmd/auth/logout"
     7  	authRefreshCmd "github.com/andrewhsu/cli/v2/pkg/cmd/auth/refresh"
     8  	authStatusCmd "github.com/andrewhsu/cli/v2/pkg/cmd/auth/status"
     9  	"github.com/andrewhsu/cli/v2/pkg/cmdutil"
    10  	"github.com/spf13/cobra"
    11  )
    12  
    13  func NewCmdAuth(f *cmdutil.Factory) *cobra.Command {
    14  	cmd := &cobra.Command{
    15  		Use:   "auth <command>",
    16  		Short: "Login, logout, and refresh your authentication",
    17  		Long:  `Manage gh's authentication state.`,
    18  	}
    19  
    20  	cmdutil.DisableAuthCheck(cmd)
    21  
    22  	cmd.AddCommand(authLoginCmd.NewCmdLogin(f, nil))
    23  	cmd.AddCommand(authLogoutCmd.NewCmdLogout(f, nil))
    24  	cmd.AddCommand(authStatusCmd.NewCmdStatus(f, nil))
    25  	cmd.AddCommand(authRefreshCmd.NewCmdRefresh(f, nil))
    26  	cmd.AddCommand(gitCredentialCmd.NewCmdCredential(f, nil))
    27  
    28  	return cmd
    29  }