1

I create a custom command via

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


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

and I would like to set a tooltip, but I could not find how to do that. Currently the waf --help looks like this (truncated):

Main commands (example: ./waf build -j4)
build    : executes the build
...
updatepo : 
...
drahnr
  • 6,782
  • 5
  • 48
  • 75

1 Answers1

2

Just describe your method/class by either "" or """ """

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

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

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

This should give you something like this:

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

            MultiLine

spawnpot :  SpawnPot Build Context Description
...
user2113384
  • 111
  • 1
  • If I comment the method, it will show up in the list of commands If I comment the class, waf will moan about syntax – drahnr Mar 04 '13 at 22:29
  • To make this clear, you need to use `"""some foo"""` for the class comments to appear as expected, `waf 1.7.15` – drahnr Feb 05 '14 at 12:36