[get] print url option

This commit is contained in:
lapwat
2024-08-14 23:32:33 +02:00
parent 1b2be1c390
commit 403fdcc0f0
7 changed files with 115 additions and 54 deletions

View File

@@ -33,6 +33,7 @@ type GetOptions struct {
threads int
include bool
useLinkName bool
printURL bool
}
var getOpts *GetOptions
@@ -46,6 +47,7 @@ func init() {
getCmd.Flags().StringVarP(&getOpts.output, "output", "", "", "file name (default: book name)")
getCmd.Flags().BoolVarP(&getOpts.stdout, "stdout", "", false, "print to standard output")
getCmd.Flags().BoolVarP(&getOpts.images, "images", "", false, "retrieve images only")
getCmd.Flags().BoolVarP(&getOpts.printURL, "print-url", "", false, "print url after chapter title")
getCmd.Flags().BoolVarP(&getOpts.quiet, "quiet", "q", false, "hide progress bar")
// common with list command
@@ -147,6 +149,7 @@ var getCmd = &cobra.Command{
config.ImagesOnly = getOpts.images
config.Include = getOpts.include
config.UseLinkName = getOpts.useLinkName
config.PrintURL = getOpts.printURL
// do not use link name for root level as there is not parent link
if index == 0 {

View File

@@ -14,6 +14,6 @@ var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version number of papeer",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("papeer v0.8.1")
fmt.Println("papeer v0.8.2")
},
}