Re: [racket-users] Custom command completion?

2016-09-22 Thread Sam Tobin-Hochstadt
Right now, `raco` doesn't have anything like that, for either built-in
or custom commands. What there is currently is this code:
https://github.com/racket/shell-completion which basically hard-codes
options, and calls `racket` to complete `raco` commands. It knows
specifically about `raco planet` so that it can complete for that.

You could write something that used `get-info` to get the relevant
information from a spec like you describe there, and add it to that
code. A warning: those completion scripts start slower than I'd like
when I use them, because of Racket's startup time.

Sam

On Thu, Sep 22, 2016 at 5:37 PM, Jack Firth  wrote:
> Right, but shell completion varies by shell implementaiton so I was hoping 
> that raco
> would have some built-in completion script that racket installs, and that 
> script would
> dispatch to some racket code that implements custom completion for a 
> particular command
> I'd like to stick something like this in an info.rkt file:
>
> (define raco-commands
>   '(("some-command" command-impl-mod "Some command" 20 #:complete-with 
> (completion-impl-mod completion-procedure-binding
>
> ...and have `raco` setup a single completion script on installation that 
> notices when you're
> completing a command with custom completion and dispatches to it. That way I 
> don't have
> to figure out how to get raco pkg install to put shell scripts in the right 
> places.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Custom command completion?

2016-09-22 Thread Jack Firth
Right, but shell completion varies by shell implementaiton so I was hoping that 
raco
would have some built-in completion script that racket installs, and that 
script would
dispatch to some racket code that implements custom completion for a particular 
command
I'd like to stick something like this in an info.rkt file:

(define raco-commands
  '(("some-command" command-impl-mod "Some command" 20 #:complete-with 
(completion-impl-mod completion-procedure-binding

...and have `raco` setup a single completion script on installation that 
notices when you're
completing a command with custom completion and dispatches to it. That way I 
don't have
to figure out how to get raco pkg install to put shell scripts in the right 
places.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Custom command completion?

2016-09-22 Thread Sam Tobin-Hochstadt
Shell completion (at least for bash, which I know best) isn't handled
by `raco` at all -- it's all done in bash. So I think you'd have to do
some shell script hacking.

Sam

On Thu, Sep 22, 2016 at 5:30 PM, Jack Firth  wrote:
> If I have a `raco` command that I want to add command completion too, how can 
> I do that?
> Ideally I'm looking for some way to tell raco to dispatch to a particular 
> function whenever
> shell completion is requested for any uses of my raco command. If there is no 
> way to do this
> right now, what would I need to build for it?
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Custom command completion?

2016-09-22 Thread Jack Firth
If I have a `raco` command that I want to add command completion too, how can I 
do that?
Ideally I'm looking for some way to tell raco to dispatch to a particular 
function whenever
shell completion is requested for any uses of my raco command. If there is no 
way to do this
right now, what would I need to build for it?

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.