[kde-linux] KDE and Ruby

Kevin Krammer kevin.krammer at gmx.at
Tue Mar 14 10:17:12 UTC 2006


On Tuesday 14 March 2006 05:18, Skip Coon wrote:
> Hey all,
>
> I am using the KDE bindings for Ruby (Korundum).  I have had no luck in
> passing extra CLI args into my program.  I have searched and been on irc
> but have not had any success.
>
> I want to pass a file into my program like this: foo.rb -f bar.mp3
>
> I think I need to use KDE::CmdLIneArgs.addCmdLineOptions but when I try and
> add a new arg, I  get an error that says -f is not valid and give me a (not
> very) help screen.  I would like to be able to name my argument flags on my
> own, not rely on using some of the presets.  ie: foo.rb --config bar.mp3

The documentation on this is a little bit complex:

http://tinyurl.com/q7yk2

In your case it will look like this

aboutData = KDE::AboutData.new("foo", "Foo Player", "0.1")

KDE::CmdLineArgs::init(ARGV, aboutData)

options = [ [ "f <file>", "input file", "" ] ]

KDE::CmdLineArgs.addCmdLineOptions(options)

app = KDE::Application.new()

cheers,
Kevin

-- 
Kevin Krammer <kevin.krammer at gmx.at>
Qt/KDE Developer, Debian User
Moderator: www.mrunix.de (German), www.qtcentre.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-linux/attachments/20060314/ca48f2a2/attachment.sig>


More information about the kde-linux mailing list