热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Usetheinfinitiveverbform(‘print’)insteadofthethirdsingular(‘prints’)inhelpmessages

Iwouldliketoproposeswitchingtheverbformusedintheexamples,butespeciallyin

I would like to propose switching the verb form used in the examples, but especially in the default help messages, to using the infinitive or imperative form. For example, ‘prints’ would become ‘print’.

The verb used in the default help messages such as ‘Prints version information’ clashes with the form I use in my help messages, for example ‘Suppress header rewriting’. Looking at a couple of CLI’s I’ve used most recently on my machine (cargo, rustup, git, rsync, grep, vim, emacs), I’m beginning to believe that the infinitive form, without the third person singular suffix -s, is preferable.

I do myself use the finite form when writing API documentation for functions (‘Prints version information’, read: ‘[this method] prints version information’), but I think options and flags are different. Options and flags change how a program does something or what a program does, they don’t themselves ‘do’ something like a function does.

Anyway, I don’t want to make a linguistic argument here, instead I want to argue for good defaults, and in this case, looking at existing CLI’s, in my opinion the infinitive verb form would be a better default.

Thank you for your consideration!

该提问来源于开源项目:clap-rs/clap

You can override this messages with




1
help_message

and

1
version_message

respectively. I think this resolves the issue, feel free to reopen.





   



推荐阅读
author-avatar
袁沮战_246
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有