skygragon / leetcode-cli

A cli tool to enjoy leetcode!
MIT License
3.64k stars 457 forks source link

[Feature Request] Support customized filename #121

Closed mogita closed 5 years ago

mogita commented 6 years ago

Problem Summary

With the show command generating a source code file, it'll be even better if we can specify a format. But I have a repo already holding all my LC source files, but the filename structures are different.

Leetcode-cli's format is as 1.two-sum.js, while mine were 292. Nim Game.js with 1) a space between "292." and the question name, and 2) Title Case instead of kebab-case.

Do you have plans to support customization to the filename format? Thank you!

How to reproduce

  1. Run leetcode show 1 -g -l javascript as an example
  2. A file named 1.two-sum.js will be generated

Environment

 _           _                  _
| |         | |                | |
| | ___  ___| |_  ___  ___   __| | ___
| |/ _ \/ _ \ __|/ __|/ _ \ / _` |/ _ \
| |  __/  __/ |_  (__| (_) | (_| |  __/
|_|\___|\___|\__|\___|\___/ \__,_|\___|  CLI v2.5.2

[Environment]
Node                 v8.11.3
OS                   darwin 17.7.0
Cache                /Users/yun.wang/.lc/cache
Config               /Users/yun.wang/.lc/config.json

[Configuration]
autologin            {"enable":false,"retry":2}
code                 {"editor":"vim","lang":"cpp"}
color                {"enable":true,"theme":"default"}
icon                 {"theme":""}
network              {"concurrency":10}

[Themes]
Colors               blue,dark,default,molokai,orange,pink,solarized,solarized.light
Icons                ascii,default,win7

[Plugins]
cache                default
retry                default
leetcode             default
skygragon commented 5 years ago

@mogita please try latest release, see https://skygragon.github.io/leetcode-cli/advanced#file-name for more details.