You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: `The export command provides functionality to export bookmarks to other browser or application formats. `,
42
42
Commands: []*cli.Command{
43
-
exportHTMLCmd,
43
+
exportNSHTMLCmd,
44
+
exportPocketHTMLCmd,
45
+
exportJSONCmd,
46
+
exportRSSCmd,
44
47
},
45
48
}
46
49
47
-
varexportHTMLCmd=&cli.Command{
50
+
varoverwriteFlag=&cli.BoolFlag{
51
+
Name: "force",
52
+
Aliases: []string{"f"},
53
+
Usage: "Overwrite existing files without prompting",
54
+
}
55
+
56
+
varexportNSHTMLCmd=&cli.Command{
48
57
Name: "html",
49
58
Usage: "Export bookmarks to Netscape bookmark format (HTML)",
50
59
Description: `Exports all bookmarks to a file in Netscape bookmark format, which is compatible with most modern browsers.`,
51
60
ArgsUsage: "path/to/export.html",
52
-
Action: exportToHTML,
61
+
Action: exportToFormat(export.NetscapeHTML),
53
62
Arguments: []cli.Argument{
54
63
&cli.StringArg{
55
64
Name: "path",
@@ -59,66 +68,115 @@ var exportHTMLCmd = &cli.Command{
59
68
},
60
69
},
61
70
},
62
-
Flags: []cli.Flag{
63
-
&cli.BoolFlag{
64
-
Name: "force",
65
-
Aliases: []string{"f"},
66
-
Usage: "Overwrite existing files without prompting",
71
+
Flags: []cli.Flag{overwriteFlag},
72
+
}
73
+
74
+
varexportJSONCmd=&cli.Command{
75
+
Name: "json",
76
+
Usage: "Export bookmarks to JSON format (Pinboard/Wallabag)",
77
+
Description: `Exports all bookmarks to a file in JSON format compatible with Pinboard and Wallabag.`,
78
+
ArgsUsage: "path/to/export.json",
79
+
Action: exportToFormat(export.JSON),
80
+
Arguments: []cli.Argument{
81
+
&cli.StringArg{
82
+
Name: "path",
83
+
UsageText: "Export bookmarks to JSON format (Pinboard/Wallabag). The exported file can be imported into Pinboard, Wallabag and other applications that support this standard format.",
returnfmt.Errorf("file %s already exists. Use -f to overwrite", path)
76
-
}
110
+
// exports to pocket export html file format
111
+
varexportPocketHTMLCmd=&cli.Command{
112
+
Name: "pocket-html",
113
+
Usage: "Export bookmarks to Pocket HTML format",
114
+
Description: `Exports all bookmarks to a file in Pocket HTML format.`,
115
+
ArgsUsage: "path/to/export.html",
116
+
Action: exportToFormat(export.PocketHTML),
117
+
Arguments: []cli.Argument{
118
+
&cli.StringArg{
119
+
Name: "path",
120
+
UsageText: "Export bookmarks to Pocket HTML format. The exported file can be imported into Pocket and other applications that support this standard format.",
0 commit comments