[Alsaplayer-devel]python interface plugin
Andy Lo A Foe
Sat, 13 Apr 2002 13:44:59 +0200
On Sat, Apr 13, 2002 at 07:12:30AM +0700, Evgeny Chukreev wrote:
> It looks like alsaplayer doesn't see more than two options in such
> context (#!)!
> becouse if I type 'alsaplayer -v -v' in command line AP shows me version
Ok, I know what is happening now. The #! construct passes everything
after the command as the first argument, the second argument will be the
name of the script. So #!/usr/local/bin/alsaplayer -i text will get
argv = "/usr/local/bin/alsaplayer"
argv = "-i text"
argv = "/tmp/lala"
(/tmp/lala is the file containing the #!)
Of course alsaplayer chokes on this. One possible solution might be to
pass the interface in the name. There is support for the following in
/usr/local/bin/alsaplayer = main alsaplayer binary
# ln -s /usr/local/bin/alsaplayer /usr/local/bin/alsaplayer-python
This will create a symlink /usr/local/bin/alsaplayer-python which points
to the main binary. AlsaPlayer will detect this format and take the
string after the - as the interface plugin to load so it will be like
running "alsaplayer -i python". Replace python with any name of a valid
Another solution is to detect when we are called from a script and to
the right parsing, this is hard.