simon-git: putty (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Thu Dec 7 20:19:34 GMT 2017


TL;DR:
  b9a2551 Centralise PuTTY and Plink's non-option argument handling.

Repository:     https://git.tartarus.org/simon/putty.git
On the web:     https://git.tartarus.org/?p=simon/putty.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2017-12-07 20:19:34

commit b9a25510b0c31468a649660966b093e46b7e9533
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=b9a25510b0c31468a649660966b093e46b7e9533;hp=81345e9a8251206164199bc3aaf592e20f816143
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Dec 7 19:59:43 2017 +0000

    Centralise PuTTY and Plink's non-option argument handling.
    
    This is another piece of long-overdue refactoring similar to the
    recent commit e3796cb77. But where that one dealt with normalisation
    of stuff already stored _in_ a Conf by whatever means (including, in
    particular, handling a user typing 'username at host.name' into the
    Hostname box of the GUI session dialog box), this one deals with
    handling argv entries and putting them into the Conf.
    
    This isn't exactly a pure no-functional-change-at-all refactoring. On
    the other hand, it isn't a full-on cleanup that completely
    rationalises all the user-visible behaviour as well as the code
    structure. It's somewhere in between: I've preserved all the behaviour
    quirks that I could imagine a reason for having intended, but taken
    the opportunity to _not_ faithfully replicate anything I thought was
    clearly just a bug.
    
    So, for example, the following inconsistency is carefully preserved:
    the command 'plink -load session nextword' treats 'nextword' as a host
    name if the loaded session hasn't provided a hostname already, and
    otherwise treats 'nextword' as the remote command to execute on the
    already-specified remote host, but the same combination of arguments
    to GUI PuTTY will _always_ treat 'nextword' as a hostname, overriding
    a hostname (if any) in the saved session. That makes some sense to me
    because of the different shapes of the overall command lines.
    
    On the other hand, there are two behaviour changes I know of as a
    result of this commit: a third argument to GUI PuTTY (after a hostname
    and port) now provokes an error message instead of being silently
    ignored, and in Plink, if you combine a -P option (specifying a port
    number) with the historical comma-separated protocol selection prefix
    on the hostname argument (which I'd completely forgotten even existed
    until this piece of work), then the -P will now override the selected
    protocol's default port number, whereas previously the default port
    would win. For example, 'plink -P 12345 telnet,hostname' will now
    connect via Telnet to port 12345 instead of to port 23.
    
    There may be scope for removing or rethinking some of the command-
    line syntax quirks in the wake of this change. If we do decide to do
    anything like that, then hopefully having it all in one place will
    make it easier to remove or change things consistently across the
    tools.

 cmdline.c          | 263 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 putty.h            |   6 ++
 unix/gtkmain.c     |  27 +++---
 unix/unix.h        |   1 -
 unix/uxplink.c     | 245 +++++++++++++++----------------------------------
 unix/uxpterm.c     |   5 -
 unix/uxputty.c     |  61 +------------
 windows/window.c   |  70 +++-----------
 windows/winplink.c | 219 +++++++++++++-------------------------------
 9 files changed, 430 insertions(+), 467 deletions(-)



More information about the tartarus-commits mailing list