From cb4d39b4a7be4e44279bd33e1676674071b539e4 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Sun, 21 Sep 2025 15:20:13 -0400 Subject: [PATCH] feat(cache): auto-completion to the cli1 --- plugin/cp.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugin/cp.lua b/plugin/cp.lua index 2bf4707..260aa34 100644 --- a/plugin/cp.lua +++ b/plugin/cp.lua @@ -40,8 +40,18 @@ end, { return vim.tbl_filter(function(cmd) return cmd:find(ArgLead, 1, true) == 1 end, candidates) + elseif num_args == 3 then + if args[2] == 'cache' then + return vim.tbl_filter(function(cmd) + return cmd:find(ArgLead, 1, true) == 1 + end, { 'clear' }) + end elseif num_args == 4 then - if vim.tbl_contains(platforms, args[2]) then + if args[2] == 'cache' and args[3] == 'clear' then + return vim.tbl_filter(function(cmd) + return cmd:find(ArgLead, 1, true) == 1 + end, platforms) + elseif vim.tbl_contains(platforms, args[2]) then local cache = require('cp.cache') cache.load() local contest_data = cache.get_contest_data(args[2], args[3])