docs: document packages, exported API and non-obvious logic

This commit is contained in:
Mathis Maquenne
2026-08-06 13:04:10 +02:00
parent 5dfd832d0d
commit b1ad9b4904
41 changed files with 757 additions and 7 deletions
+10
View File
@@ -38,6 +38,16 @@ func newDownloadCmd() *cobra.Command {
return cmd
}
// newDownloadSubCmd builds one download subcommand from a deezer.Kind. The
// four kinds differ only in wording and in whether they take a track limit,
// so they share this constructor rather than being written out four times.
//
// All four share one Options value through the parent's persistent flags,
// which is safe because exactly one subcommand ever runs.
//
// A cancelled download is reported as success: the user pressed Ctrl-C and
// has already seen the progress output, so an error on top of it would be
// noise, and a non-zero exit would misreport a deliberate stop as a failure.
func newDownloadSubCmd(kind deezer.Kind, opts *download.Options) *cobra.Command {
cmd := &cobra.Command{
Use: fmt.Sprintf("%s <%s_id>", kind, kind),