commands

package
v0.0.0-...-099dad8 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Commands = []*cli.Command{
	{
		Name:   "version",
		Usage:  "Show the application's version",
		Action: versionCommand,
	},
	{
		Name:   "webarchive",
		Usage:  "Work with WebArchives",
		Action: webArchiveCommand,
		Flags: []cli.Flag{
			&cli.StringFlag{
				Name:  "path",
				Usage: "Path to read",
				Value: "",
			},
		},
	},
	{
		Name:   "warc",
		Usage:  "Work with WARCs",
		Action: warcCommand,
		Flags: []cli.Flag{
			&cli.StringFlag{
				Name:  "path",
				Usage: "Path to read",
				Value: "",
			},
			&cli.BoolFlag{
				Name:  "compressed",
				Usage: "Whether or not to treat the input archive as compressed. True by default if extension ends with '.gz'",
				Value: false,
			},
		},
	},
	{
		Name:   "archive",
		Usage:  "Archive sites",
		Action: archiveCommand,
		Flags: []cli.Flag{
			&cli.StringSliceFlag{
				Name:  "url",
				Usage: "URL to a resource to archive. May be used more than once.",
			},
			&cli.BoolFlag{
				Name:  "headers-only",
				Usage: "Only print headers for the resulting WARC file",
				Value: false,
			},
			&cli.UintFlag{
				Name:  "parallelism",
				Usage: "The number of concurrent jobs to perform",
				Value: 5,
			},
			&cli.StringFlag{
				Name:    "output",
				Aliases: []string{"o"},
				Usage:   "The path to write the output too. If output is not specified, stdout will be used.",
			},
			&cli.BoolFlag{
				Name:    "compress",
				Aliases: []string{"c"},
				Usage:   "Whether or not to compress the WARC using gzip.",
				Value:   false,
			},
		},
	},
	{
		Name:   "convert",
		Usage:  "Convert between formats",
		Action: convertCommand,
		Flags: []cli.Flag{
			&cli.StringFlag{
				Name:    "input",
				Aliases: []string{"i"},
				Usage:   "Input path",
				Value:   "",
			},
			&cli.StringFlag{
				Name:  "input-format",
				Usage: "Input format. One of 'warc', 'warc.gz'",
				Value: "warc",
			},
			&cli.StringFlag{
				Name:    "output",
				Aliases: []string{"o"},
				Usage:   "Output path",
				Value:   "",
			},
			&cli.StringFlag{
				Name:  "output-format",
				Usage: "Output file format. One of 'dir', 'tar', 'tgz'",
				Value: "",
			},
		},
	},
	{
		Name:      "serve",
		Usage:     "Serve a WARC archive",
		Action:    serveCommand,
		ArgsUsage: "<path to archive>",
		Flags: []cli.Flag{
			&cli.UintFlag{
				Name:    "port",
				Aliases: []string{"p"},
				Usage:   "Port to listen on",
				Value:   8080,
			},
			&cli.StringFlag{
				Name:  "address",
				Usage: "Address to listen on",
				Value: "",
			},
			&cli.BoolFlag{
				Name:  "no-interface",
				Usage: "Disable the Larch interface",
				Value: false,
			},
			&cli.BoolFlag{
				Name:  "compressed",
				Usage: "Whether or not to treat the input archive as compressed. True by default if extension ends with '.gz'",
				Value: false,
			},
			&cli.StringFlag{
				Name:     "site",
				Usage:    "The host part of the site to serve",
				Required: true,
			},
		},
	},
}

Commands contains all commands of the application

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