cmd

package
v0.0.0-...-abf94f0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ListRepositoriesCommand = &cli.Command{
	Name:    "list-repositories",
	Aliases: []string{"lr"},
	Usage:   "List all repositories for a user",
	Action: func(c *cli.Context) error {

		client := util.GetGitHubClient()

		user, _, err := client.Users.Get(c.Context, "")
		if err != nil {
			return err
		}

		repos, _, err := client.Repositories.List(c.Context, *user.Login, nil)
		if err != nil {
			return err
		}

		fmt.Println("Repositories for", *user.Login)
		for _, repo := range repos {
			fmt.Println(*repo.Name)
		}

		return nil
	},
}

ListRepositoriesCommand represents the "list-repositories" command

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL