cf-tool icon indicating copy to clipboard operation
cf-tool copied to clipboard

Warning:Choose valid language

Open W-X-Dai opened this issue 1 year ago • 4 comments

When I enter "cf submit", it returns the warning of "Choose valid language" which hadn't occur before.

W-X-Dai avatar Feb 08 '24 04:02 W-X-Dai

Me too. I think it might that the language can not be used. But I try to set a new template. After it, I still can not solve this problem.

youkeliao avatar Feb 08 '24 08:02 youkeliao

Me too. I think it might that the language can not be used. But I try to set a new template. After it, I still can not solve this problem.

perhaps codeforces change its api?

W-X-Dai avatar Feb 08 '24 08:02 W-X-Dai

I had the same problem. Codeforces changed its set of languages, removing the one that I was using in my template.

The quick fix:

  • Go to https://codeforces.com/contest/1956/submit (or any other contest) and inspect Language dropdown using your browser developer tools - you'll see list of languages and their ids.
  • Go to https://github.com/xalanq/cf-tool/blob/master/client/langs.go - this is a list of languages hardcoded into cf-tool
  • Find ID for your language that appears in both lists. For C++, the best choice as of today is 54 - GNU G++17 7.3.0.
  • Use cf config to delete your old template, then create the new template (instructions for CP editor) and chose language ID from previous step.

fedimser avatar Apr 17 '24 03:04 fedimser

picking a language id from inspecting the dropdown seems to work, even if it's not in the hardcoded list of cf-tool

teiknsmith avatar Jul 30 '24 18:07 teiknsmith