mirror of
https://github.com/Belphemur/CBZOptimizer.git
synced 2026-01-11 16:17:04 +01:00
Consolidate all common flags into flags.go
- Create individual setup functions for each common flag (quality, override, split, timeout) - Create setupCommonFlags function that sets up all common flags in one call - Simplify optimize_command.go and watch_command.go by using setupCommonFlags - All flags now centralized in flags.go for better maintainability - All tests continue to pass Co-authored-by: Belphemur <197810+Belphemur@users.noreply.github.com>
This commit is contained in:
@@ -25,13 +25,11 @@ func init() {
|
||||
Args: cobra.ExactArgs(1),
|
||||
}
|
||||
|
||||
setupFormatFlag(command, &converterType, false)
|
||||
|
||||
command.Flags().Uint8P("quality", "q", 85, "Quality for conversion (0-100)")
|
||||
// Setup common flags (format, quality, override, split, timeout)
|
||||
setupCommonFlags(command, &converterType, 85, false, false, false)
|
||||
|
||||
// Setup optimize-specific flags
|
||||
command.Flags().IntP("parallelism", "n", 2, "Number of chapters to convert in parallel")
|
||||
command.Flags().BoolP("override", "o", false, "Override the original CBZ/CBR files")
|
||||
command.Flags().BoolP("split", "s", false, "Split long pages into smaller chunks")
|
||||
command.Flags().DurationP("timeout", "t", 0, "Maximum time allowed for converting a single chapter (e.g., 30s, 5m, 1h). 0 means no timeout")
|
||||
|
||||
AddCommand(command)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user