list

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: MIT Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package list provides the command to list project issues.

Index

Constants

This section is empty.

Variables

View Source
var ListCmd = &cobra.Command{
	Use:     "list",
	Aliases: []string{"ls"},
	RunE: func(cmd *cobra.Command, _ []string) error {
		presenter := ui.NewPresenter(cmd.OutOrStdout(), cmd.ErrOrStderr())
		ctx := cmd.Context()

		provider, err := newProvider(ctx, globals.AppLogger, globals.LoadedAppConfig)
		if err != nil {
			presenter.Error("Failed to initialize work item provider: %v", err)

			return err
		}

		listOpts := workitem.ListOptions{
			Limit:    issueLimit,
			Assignee: issueAssignee,
		}
		if issueLabel != "" {
			listOpts.Labels = []string{issueLabel}
		}
		switch issueState {
		case "closed":
			listOpts.State = workitem.StateClosed
		default:
			listOpts.State = workitem.StateOpen
		}

		presenter.Summary("Fetching Work Items...")
		items, err := provider.ListItems(ctx, listOpts)
		if err != nil {
			presenter.Error("Failed to list work items: %v", err)

			return fmt.Errorf("failed to list items: %w", err)
		}

		if len(items) == 0 {
			presenter.Info("No work items found matching the criteria.")

			return nil
		}

		if fullView {
			for _, item := range items {
				detailedItem, err := provider.GetItem(ctx, item.Number, false)
				if err != nil {
					presenter.Warning("Could not fetch details for #%d: %v", item.Number, err)

					continue
				}
				internal.DisplayWorkItem(presenter, detailedItem)
			}
		} else {
			for _, item := range items {

				fmt.Fprintf(presenter.Out(), "#%d [%s] %s\n", item.Number, item.State, item.Title)
			}
		}

		return nil
	},
}

ListCmd represents the project issues list 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