【问题标题】:In the pants buildtool, what is the difference between 'advanced' options and regular options?在裤子构建工具中,“高级”选项和常规选项有什么区别?
【发布时间】:2015-04-03 13:25:27
【问题描述】:

当你在没有选项的情况下运行 ./pants 时,你会得到帮助:

$ ./pants help
Pants 0.0.32 https://pypi.python.org/pypi/pantsbuild.pants/0.0.32

Usage:
  ./pants [option ...] [goal ...] [target...]  Attempt the specified goals.
  ./pants help                                 Get help.
  ./pants help [goal]                          Get help for a goal.
  ./pants help-advanced [goal]                 Get help for a goal's advanced options.
  ./pants help-all                             Get help for all goals.
  ./pants goals                                List all installed goals.

我注意到您也可以使用 --help-advanced 标志查看它们。

为什么有些类似下面的标记为“(高级)”?

(ADVANCED)
--pants-bootstrapdir <dir>
                        Use this dir for global cache. (default:
                        /Users/zundel/.cache/pants)
(ADVANCED)
--pants-configdir <dir>
                        Use this dir for global config files. (default:
                        /Users/zundel/.config/pants)

【问题讨论】:

  • 这有关系吗?提供了高级帮助,因此高级用户可以使用高级功能通过该工具执行高级操作:)

标签: python pants


【解决方案1】:

高级选项不适合从命令行使用,因此通常不会显示在传统的 (-h,--help) 命令行帮助中。如果这些选项需要与裤子标准默认值不同,则打算在该仓库的pants.ini 配置文件中为使用裤子的仓库全局设置一次。在命令行上显示这些针对pants.ini 的选项的帮助这一事实绝对是奇怪的,从某种意义上说,为这些选项提供文档是一种折衷的便利。

因此,对于具有一两个“高级”用户的小型存储库而言,与许多开发人员使用的大型存储库相比,这可能是用词不当。在较小的情况下,可能两个开发人员都需要在该回购中使用裤子的过程中设置或调整他们的回购pants.ini。在包含许多开发人员的大型 repo 案例中,很少有开发人员会调整 pants.ini,因此对于此类 repo 中的普通裤子用户来说,这些选项确实是“高级”的,几乎没有用处。

【讨论】:

    猜你喜欢
    • 2011-06-01
    • 2013-07-24
    • 1970-01-01
    • 2014-09-20
    • 2010-10-26
    • 2018-10-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多