list

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cli.Command{
	Name:  "list",
	Usage: "List all releases of the specified software",
	Flags: []cli.Flag{
		&cli.BoolFlag{
			Name:  "semver",
			Usage: "display parsed semver instead of the original version name.",
		},
	},
	Action: func(c *cli.Context) error {
		q, err := parser.Parse(c.Args().First())
		if err != nil {
			return err
		}

		fetcher := fetch.Direct{}
		rs, err := q.Execute(c.Context, fetcher)
		if err != nil {
			return err
		}

		if c.Bool("semver") {
			for _, r := range rs {
				fmt.Printf("%s\n", r.Version)
			}

			return nil
		}
		for _, r := range rs {
			fmt.Printf("%s\n", r.OriginalName)
		}

		return nil
	},
}

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