shiori/internal/cmd/print.go

21 lines
643 B
Go
Raw Normal View History

2019-05-21 11:31:40 +08:00
package cmd
import "github.com/spf13/cobra"
func printCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "print [indices]",
Short: "Print the saved bookmarks",
Long: "Show the saved bookmarks by its DB index. " +
"Accepts space-separated list of indices (e.g. 5 6 23 4 110 45), " +
"hyphenated range (e.g. 100-200) or both (e.g. 1-3 7 9). " +
"If no arguments, all records with actual index from database are shown.",
Aliases: []string{"list", "ls"},
}
cmd.Flags().BoolP("json", "j", false, "Output data in JSON format")
cmd.Flags().BoolP("index-only", "i", false, "Only print the index of bookmarks")
return cmd
}