caesura 0.26.0

An all-in-one command line tool to **transcode FLAC** audio files and **upload to gazelle** based indexers/trackers.
Documentation
use clap::Subcommand;

use crate::options::*;

/// Cli sub-commands and arguments
#[derive(Subcommand, Debug, Clone)]
pub enum CommandArguments {
    /// Read the config file if it exists and concatenate default values.
    Config,

    /// Verify, transcode, and upload from multiple FLAC sources in one command.
    Batch {
        #[command(flatten)]
        shared: SharedOptions,
        #[command(flatten)]
        target: TargetOptions,
        #[command(flatten)]
        verify: VerifyOptions,
        #[command(flatten)]
        runner: RunnerOptions,
        #[command(flatten)]
        spectrogram: SpectrogramOptions,
        #[command(flatten)]
        copy: CopyOptions,
        #[command(flatten)]
        file: FileOptions,
        #[command(flatten)]
        batch: BatchOptions,
        #[command(flatten)]
        cache: CacheOptions,
        #[command(flatten)]
        upload: UploadOptions,
    },

    /// Add FLAC sources to the queue without transcoding
    Queue {
        #[command(subcommand)]
        command: QueueCommandArguments,
    },

    /// Generate spectrograms for each track of a FLAC source.
    Spectrogram {
        #[command(flatten)]
        source: SourceArg,
        #[command(flatten)]
        shared: SharedOptions,
        #[command(flatten)]
        spectrogram: SpectrogramOptions,
        #[command(flatten)]
        runner: RunnerOptions,
    },

    /// Transcode each track of a FLAC source to the target formats.
    Transcode {
        #[command(flatten)]
        source: SourceArg,
        #[command(flatten)]
        shared: SharedOptions,
        #[command(flatten)]
        target: TargetOptions,
        #[command(flatten)]
        copy: CopyOptions,
        #[command(flatten)]
        file: FileOptions,
        #[command(flatten)]
        runner: RunnerOptions,
    },

    /// Upload transcodes of a FLAC source.
    Upload {
        #[command(flatten)]
        source: SourceArg,
        #[command(flatten)]
        shared: SharedOptions,
        #[command(flatten)]
        target: TargetOptions,
        #[command(flatten)]
        upload: UploadOptions,
        #[command(flatten)]
        copy: CopyOptions,
    },

    /// Verify a FLAC source is suitable for transcoding.
    Verify {
        #[command(flatten)]
        source: SourceArg,
        #[command(flatten)]
        shared: SharedOptions,
        #[command(flatten)]
        target: TargetOptions,
        #[command(flatten)]
        verify: VerifyOptions,
    },
}

#[derive(Subcommand, Debug, Clone)]
pub enum QueueCommandArguments {
    /// Add a directory of `.torrent` files to the queue
    Add {
        #[command(flatten)]
        shared: SharedOptions,
        #[command(flatten)]
        cache: CacheOptions,
        #[command(flatten)]
        args: QueueAddArgs,
    },

    /// List the sources in the queue
    List {
        #[command(flatten)]
        shared: SharedOptions,
        #[command(flatten)]
        cache: CacheOptions,
        #[command(flatten)]
        batch: BatchOptions,
    },

    /// Remove an item from the queue
    #[command(name = "rm")]
    Remove {
        #[command(flatten)]
        shared: SharedOptions,
        #[command(flatten)]
        cache: CacheOptions,
        #[command(flatten)]
        args: QueueRemoveArgs,
    },

    /// Summarize the sources in the queue
    Summary {
        #[command(flatten)]
        shared: SharedOptions,
        #[command(flatten)]
        cache: CacheOptions,
    },
}