[racket] Adding a raco command not working for me
If you want your tool to be in the submodule named main, your definition of
raco-commands should be:
(define raco-commands '(("frog" (submod frog main) "run Frog" #f)))
Carl Eastlund
On Mon, Apr 8, 2013 at 10:37 PM, Greg Hendershott <greghendershott at gmail.com
> wrote:
> 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"?
> >
> ____________________
> Racket Users list:
> http://lists.racket-lang.org/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130409/31e6d345/attachment.html>