1

我通过创建自定义命令

def spawn_pot(ctx):
    ctx.recurse ('po')


class spawnpot(BuildContext):
    cmd = 'spawnpot'
    fun = 'spawn_pot'

我想设置一个工具提示,但我找不到如何做到这一点。目前waf --help看起来像这样(截断):

Main commands (example: ./waf build -j4)
build    : executes the build
...
updatepo : 
...
4

1 回答 1

2

只需用 "" 或 """ """ 来描述你的方法/类

def spawn_pot(ctx):
    """ Spawn Pot Target

        Multiline
    """
    ctx.recurse ('po')

class spawnpot(BuildContext):
    "SpawnPot Build Context Description"
    cmd = 'spawnpot'
    fun = 'spawn_pot'

这应该给你这样的东西:

the_prompt> waf -h
...
spawn_pot:  Spawn Pot Target

            MultiLine

spawnpot :  SpawnPot Build Context Description
...
于 2013-02-27T00:01:48.873 回答