This commit introduces a new `collect website` command that recursively downloads a website to a specified depth. - A new `pkg/website` package contains the logic for the recursive download. - A new `pkg/ui` package provides a progress bar for long-running operations, which is used by the website downloader. - The `collect pwa` subcommand has been restored to be PWA-specific.
15 lines
422 B
Go
15 lines
422 B
Go
package ui
|
|
|
|
import (
|
|
"github.com/schollz/progressbar/v3"
|
|
)
|
|
|
|
// NewProgressBar creates a new progress bar with the specified total and description.
|
|
func NewProgressBar(total int, description string) *progressbar.ProgressBar {
|
|
return progressbar.NewOptions(total,
|
|
progressbar.OptionSetDescription(description),
|
|
progressbar.OptionSetWidth(15),
|
|
progressbar.OptionShowCount(),
|
|
progressbar.OptionClearOnFinish(),
|
|
)
|
|
}
|