[racket] Adding a raco command not working for me

From: Greg Hendershott (greghendershott at gmail.com)
Date: Mon Apr 8 22:37:00 EDT 2013

Ah. You mean I need an info.rkt for the package, and _another_ one for
the frog collection?  That seems obvious now that you say it, but I
hadn't realized that.  So: info.rkt files are used both for packages
and collections.

Thank you.

My next dumb question: My frog.rkt has the command-line "main"-ish
functionality in a `(module+ main ...)` [1].  But raco doesn't seem to
find/run that.

On a hunch I moved the main-ish stuff out into the frog.rkt file
module. Now raco does execute it. But that way, it runs always -- even
if I'm e.g. executing the `test` module with raco test.

Is this as-intended, or am I making another mistake preventing raco
from running it inside `(module+ main ...)`?

[1]: https://github.com/greghendershott/frog/blob/master/frog.rkt#L1162


On Mon, Apr 8, 2013 at 6:52 PM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> Here's a thought:
>
> At Sat, 6 Apr 2013 10:21:53 -0400, Greg Hendershott wrote:
>> I'm trying to add a raco command, following
>> http://docs.racket-lang.org/raco/command.html
>>
>> My info.rkt is simply this:
>>
>>     #lang setup/infotab
>>     (define deps (list "markdown" "rackjure"))
>>     (define raco-commands '(("frog" frog "run Frog" #f)))
>
> That `deps' line makes sense for a package. That is, it makes sense in
> "frog/info.rkt", where "frog" is the package.
>
> The `raco-commands' line makes sense for a collection. That is, it
> makes sense in "frog/frog/info.rkt".
>
> Which path are you using for "info.rkt"?
>

Posted on the users mailing list.