cmd

package
v0.0.0-...-0eb02eb Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const MaxWorkers = 1000

Variables

View Source
var (
	RootCmd = &cobra.Command{
		Use:   "timbu [flags] url",
		Short: "a fast HTTP downloader",
		Long:  "a fast HTTP downloader that uses multiple connections to download files",
		Args: func(cmd *cobra.Command, args []string) error {
			switch {
			case len(args) < 1:
				return fmt.Errorf("no url was specified")
			case len(args) > 1:
				return fmt.Errorf("multiple downloads are not supported yet")
			}
			return nil
		},
		PersistentPreRun: func(cmd *cobra.Command, args []string) {
			cmd.SilenceUsage = true
		},
		RunE: func(cmd *cobra.Command, args []string) error {
			err := run(cmd, args)
			if errors.Is(err, cmd.Context().Err()) {
				return context.Cause(cmd.Context())
			}
			return err
		},
	}
)

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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