tool

package
v0.5.14 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExtractCarCmd = &cli.Command{
	Name:     "extract-car",
	Category: "Utility",
	Usage:    "Extract folders or files from a folder of CAR files to a local directory",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:     "input-dir",
			Usage:    "Input directory containing CAR files. This directory will be scanned recursively",
			Required: true,
			Aliases:  []string{"i"},
		},
		&cli.StringFlag{
			Name:    "output",
			Usage:   "Output directory or file to extract to. It will be created if it does not exist",
			Aliases: []string{"o"},
			Value:   ".",
		},
		&cli.StringFlag{
			Name:     "cid",
			Usage:    "CID of the folder or file to extract",
			Required: true,
			Aliases:  []string{"c"},
		},
	},
	Action: func(c *cli.Context) error {
		inputDir := c.String("input-dir")
		output := c.String("output")
		id := c.String("cid")
		cidValue, err := cid.Decode(id)
		if err != nil {
			return errors.Wrap(err, "failed to decode CID")
		}

		return tool.ExtractCarHandler(c, inputDir, output, cidValue)
	},
}

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