[Scons-users] Getting a list of aliases from Scons

Pico Geyer picogeyer at gmail.com
Thu Oct 31 12:09:56 EDT 2013


Hi all.

Is there a way in Scons to get a list of aliases that have been defined in
my Sconscript files.
I want to automate my Help() message by listing all aliases.

So for example for example:

env.Alias('foo', foo_program)
env.Alias('bar', bar_program)

Help('You can build the following: {}'.format(' '.join(ALIAS_LIST))

I want the above to help message to say:
You can build the following: foo bar

I eventually came up with the following hack:
def myalias(env, alias, target):
alias_cmd = env['ORIG_ALIAS']
alias_cmd(alias, target)
if 'ALIAS_LIST' not in env:
env['ALIAS_LIST'] = []
env['ALIAS_LIST'].append(alias)

env = Environment()
env['ORIG_ALIAS'] = env.Alias
env.AddMethod(myalias, 'Alias')


Is there a better way to achieve this?

Thanks and regards,
Pico
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20131031/9106c2a2/attachment.htm


More information about the Scons-users mailing list