Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: Improve Mosh completion



Thanks for the ping on github.

Andrei Shevchuk wrote on Fri, 10 Nov 2017 03:35 +0300:
> This adds ~/.ssh/config based completion support (_ssh_hosts and 
> _ssh_users functions and userhost state handling taken without 
> modifications from ssh completion file),

Sorry, no.  https://en.wikipedia.org/wiki/Don%27t_repeat_yourself

If you really need to call those two functions, break them out of _ssh into
separate files:

    % head -n1 Completion/*/Type/_ssh_files
    #autoload
    % 

Or — depending on mosh's syntax — it might be better to simply invoke _ssh
(directly or via _normal or one of its friends).

> existing code was just wrapped into _mosh function without modifications
> (except userhost state handling mentioned above).

Please don't mix whitespace and functional changes: that makes the diff harder
to review.

> +++ b/Completion/Unix/Command/_mosh
> @@ -1,26 +1,84 @@
> +    '--port=[specify server-side port range]:port:_sequence -n 2 -s \: 
> _ports' \

As you can see, your MUA mangled the patch (hard line break).  You can avoid
this by sending patches as attachments named *.txt.

Let's continue the discussion on list; there are more eyes here.

Cheers,

Daniel



Messages sorted by: Reverse Date, Date, Thread, Author