mirror of
https://github.com/Belphemur/CBZOptimizer.git
synced 2025-10-14 12:38:50 +02:00
feat: add format setting for completion
This commit is contained in:
@@ -1,8 +1,31 @@
|
||||
package constant
|
||||
|
||||
type ConversionFormat string
|
||||
import "github.com/thediveo/enumflag/v2"
|
||||
|
||||
type ConversionFormat enumflag.Flag
|
||||
|
||||
const (
|
||||
ImageFormatWebP ConversionFormat = "webp"
|
||||
ImageFormatUnknown ConversionFormat = ""
|
||||
WebP ConversionFormat = iota
|
||||
)
|
||||
|
||||
var CommandValue = map[ConversionFormat][]string{
|
||||
WebP: {"webp"},
|
||||
}
|
||||
|
||||
var HelpText = enumflag.Help[ConversionFormat]{
|
||||
WebP: "WebP Image Format",
|
||||
}
|
||||
|
||||
var DefaultConversion = WebP
|
||||
|
||||
func (c ConversionFormat) String() string {
|
||||
return CommandValue[c][0]
|
||||
}
|
||||
|
||||
func ListAll() []string {
|
||||
var formats []string
|
||||
for _, names := range CommandValue {
|
||||
formats = append(formats, names[0])
|
||||
}
|
||||
return formats
|
||||
}
|
||||
|
Reference in New Issue
Block a user