one bug, one feature, one puff of smoke

View: New views
4 Messages — Rating Filter:   Alert me  

one bug, one feature, one puff of smoke

by Paul Phillips-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

a) There's a bug in CommandLineParser that causes it to print short options
in help text as Some(c) instead of just c.

b) One becomes acutely aware of dependencies when doing development
inside an OSGI container.  I've had to build stripped down jars for both
scalaz and scalax to avoid inheriting their dependencies on other libs.  
In scalaz's case it's reductio and functional java, and in scalax's case
it's slf4j.  I don't know if there's anything easy to do about this, but
in case I'm not the only one with these troubles, it'd be nice if there
were a standard jar with no external dependencies.

I had a c) but it was overtaken by events.

--
Paul Phillips      | Every election is a sort of advance auction sale
In Theory          | of stolen goods.
Empiricist         |     -- H. L. Mencken
up hill, pi pals!  |----------* http://www.improving.org/paulp/ *----------


Re: one bug, one feature, one puff of smoke

by Paul LaCrosse :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This updated showHelp method for the commandline.scala file may work (note: no guarantee that other changes not needed to be made elsewhere in your source)

        def showHelp(out : PrintStream) : Unit = {
                var width = 0
                for(i <- opts) {
                        val w = i.longName.length
                        if(w > width) width = w
                }
                width += 2

                out.print(helpHeader)
                for(i <- opts) {
                        if (i.shortName != None) out.print("  -" + i.shortName.get) else out.print("    ")
                        out.print("  --")
                        out.print(i.longName)
                        for(j <- Iterator.range(0, width - i.longName.length))
                                out.print(' ')
                        out.println(i.description)
                }
        }


Paul Phillips wrote:
a) There's a bug in CommandLineParser that causes it to print short options
in help text as Some(c) instead of just c.

Re: one bug, one feature, one puff of smoke

by Jon Pretty :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Paul J. LaCrosse wrote:
> This updated showHelp method for the commandline.scala file may work (note:
> no guarantee that other changes not needed to be made elsewhere in your
> source)

Thanks, Paul.  I've pushed a slightly modified version of this change to
the scalax repository.

NB. This is the first time I've ever really used Mercurial, and I've
relied on complacent intuition all the way.  Can someone please let me
know if I've messed anything up?

Cheers,
Jon

--
Jon Pretty | Sygneca Ltd.



Re: one bug, one feature, one puff of smoke

by Silvestre Zabala :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jon,

Jon Pretty wrote:
Thanks, Paul.  I've pushed a slightly modified version of this change to
the scalax repository.

NB. This is the first time I've ever really used Mercurial, and I've
relied on complacent intuition all the way.  Can someone please let me
know if I've messed anything up?
it seems as if you left the broken code in instead of replacing it. Could you please delete the two superfluous lines i.e. apply http://www.nabble.com/Patch-for-CommandLineParser-td22629244.html ?