Add a clear cache action

This commit is contained in:
Kovid Goyal
2025-11-23 12:15:29 +05:30
parent 37da04aad6
commit fae50137a9
4 changed files with 49 additions and 2 deletions

View File

@@ -748,6 +748,15 @@ var default_cwd string
var use_light_colors bool
func main(_ *cli.Command, opts *Options, args []string) (rc int, err error) {
if opts.ClearCache {
c, err := preview_cache()
if err != nil {
return 1, err
}
if err = c.Clear(); err != nil {
return 1, err
}
}
write_output := func(selections []string, interrupted bool, current_filter string) {
payload := make(map[string]any)
if err != nil {

View File

@@ -217,6 +217,11 @@ The format in which to write the output.
--write-pid-to
Path to a file to which to write the process ID (PID) of this process to.
--clear-cache
type=bool-set
Clear the caches used by this kitten.
'''.format(config_help=CONFIG_HELP.format(conf_name='choose-files', appname=appname)).format