这是indexloc提供的服务,不要输入任何密码
Skip to content

[Feature Request] Add property based info-alike command with unformatted output #283

@whjum

Description

@whjum

The original info command's ouput works well with a human reader. However, it is not working well with cli command as the user need to remove formatting character themselves to obtain the actual data. For example:

$ leetgo info 1 | grep Slug
�[37;40m Slug       �[0m�[37;40m two-sum                                            �[0m

In the above use case, I think a query alike command that prints unformatted output with property filter like slug, title, tags, testcase,etc will be helpful.

The query could using the following format: leetgo query qid [property]. For example:

$ leetgo query 1 slug
two-sum

I created a fork to demo one draft of the query command. There should be a better way to map the property of the question struct than the naive switch function. If you have a better approach, I am happy to adapt that.

Kindly let me know if you are interested in adding this command or there might be some better approaches! I am happy to be of help if possible.

Also, thank you sincerely for this wonderful tool! It makes my life a lot eaiser :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions