routeConfigCompression dispatches /config compression [args]. The "compression" token is stripped by routeConfigCommand; empty args is handled there too (shows the panorama).
(args []string)
| 34 | // "compression" token is stripped by routeConfigCommand; empty args is handled |
| 35 | // there too (shows the panorama). |
| 36 | func (cli *ChatCLI) routeConfigCompression(args []string) { |
| 37 | if len(args) == 0 { |
| 38 | cli.showConfigCompression() |
| 39 | return |
| 40 | } |
| 41 | switch strings.ToLower(strings.TrimSpace(args[0])) { |
| 42 | case "help", "-h", "--help": |
| 43 | cli.printConfigCompressionUsage() |
| 44 | case "status", "show": |
| 45 | cli.showConfigCompression() |
| 46 | case "stats": |
| 47 | cli.showCompressionStats() |
| 48 | case "prune", "gc", "cleanup", "curate": |
| 49 | cli.pruneCompressionStore() |
| 50 | case "off", "disable", "none": |
| 51 | cli.setCompressionMode("off") |
| 52 | case "lossless", "safe": |
| 53 | cli.setCompressionMode("lossless") |
| 54 | case "lossy", "lossy-with-ccr", "ccr", "on", "enable": |
| 55 | cli.setCompressionMode("lossy-with-ccr") |
| 56 | case "mode": |
| 57 | if len(args) >= 2 { |
| 58 | cli.setCompressionMode(args[1]) |
| 59 | } else { |
| 60 | cli.showConfigCompression() |
| 61 | } |
| 62 | case "profile": |
| 63 | if len(args) >= 2 { |
| 64 | cli.setCompressionProfile(args[1]) |
| 65 | } else { |
| 66 | cli.showConfigCompression() |
| 67 | } |
| 68 | case "threshold": |
| 69 | if len(args) >= 2 { |
| 70 | cli.setCompressionThreshold(args[1]) |
| 71 | } else { |
| 72 | cli.showConfigCompression() |
| 73 | } |
| 74 | default: |
| 75 | fmt.Println(colorize(" ❌ "+i18n.T("cfg.compression.set_invalid", args[0]), ColorRed)) |
| 76 | fmt.Println(colorize(" "+i18n.T("cfg.compression.set_valid"), ColorGray)) |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | // setCompressionMode flips the live layer's mode and mirrors it to the env var. |
| 81 | func (cli *ChatCLI) setCompressionMode(modeStr string) { |
nothing calls this directly
no test coverage detected