From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4226 invoked by alias); 3 Aug 2015 01:44:28 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35972 Received: (qmail 27052 invoked from network); 3 Aug 2015 01:44:25 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.0 From: Eric Cook To: zsh-workers@zsh.org Subject: [PATCH] _ssh: parse Host=hostname format in $HOME/.ssh/config Date: Sun, 2 Aug 2015 21:31:14 -0400 Message-Id: <1438565474-1988-1-git-send-email-llua@gmx.com> X-Mailer: git-send-email 2.5.0 X-Provags-ID: V03:K0:dfsj2DXUpBgo67tPn4WIgr5IB/ybxoT1+F8LAGM6cGry855ihoL 3kKocDICyMTAPGSFpAV46v3n30x8rTMKLeR4U2/3aYDIj3Ep7WSP1eK2EwPsjZO5twrj1fF ibYUdcoz5sKqAROjPNcObqKOagD2PzRilF54vg13RzngfRW0cyK3Wu8MHy+PwJ/cMGa2y/p rPZpPcJUxjd083j2R7D7Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:iUVjj2icGGU=:hnwhER1hqa4RHKOL5AjDDn jAD9kb/Jn7lx53QfKnpYZYwwIPKw/DPOrtrls/EHaY2UH233UTniflQhodd0EAmXd7+8ZhS5p wHRVivYV2NmCmjK2QvjBsbFxtzEv05ZZP2QYgbsM3G+TFTyYzGQAFSzug7/YrHfcrGw+wxjzE TQeTS4BLKReWLtujsAqk0cKdKk9wIZorq36x+VlxS/ok1hSoZjHT/7zj3BlUh+kD/9CC9LiAG J0w2wGoUBSoh48qLw4wHpKySCkF12fEq1Ox64mxu10bcy4UlMlHXJLD1zPGNGMAB6kkzRDFT/ eeduLROHTgxo20jFJqZT7r6xpszcJsgAXjSchmJMjzLH+dYQPgCGw+zY8A+gABhWa6Abkl6IG GNwPnu/3+dDfTn+1xD/shtgsA7yoMlMw2bSdByvgMB5MEdTMP54tPYvtaY+VaQcudmJ6CKrFk a82fMf8vstXxlG6yL668F/UtUTM5omoKgUMkVlkhgvt8veRbwVZY3fV1Y53ve/HcFQ1c77v0O Pu7o76Pg1qivbCUUQ4kJkisGmCy7qK/CoYBw3JIgI7CEWMQfvp/BePw2eTJZgTojAROQhBOFe ovWnQhZyFRa4Qc8um6+PGw9fJSs6gE5P9lrzY2WCdqo5WCg6Iaxms1zxNkZTy0OPZRo+msHk4 1W8luv5DnX45m9bP+yuIwXO2G9RUMnWQjJDnEPNoTvrfpQA== Currently _ssh_hosts() assumes the format of .ssh/config is ''Directive Value'', not ''Directive=Value'' or ''Directive = Value''. This patch allows matching those possible formats. I also scoped the IFS change to read since that, from what i can tell, is it's intended usecase. and prevents _wanted from showing the parsed hostnames as one element. Unfornately this code path is only taken when _combination fails. Which seems intentional, users/11333. '' ssh nonmatchingprefix '' But helps make code like this, become less necessary. '' # host completion if is42 ; then [[ -r ~/.ssh/config ]] && _ssh_config_hosts=(${${(s: :)${(ps:\t:)${${(@M)${(f)"$(<$HOME/.ssh/config)"}:#Host *}#Host}}}:#*[*?]*}) || _ssh_config_hosts=() [[ -r ~/.ssh/known_hosts ]] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() [[ -r /etc/hosts ]] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(