Bug 2690 - Add command line "ssh --version"
Summary: Add command line "ssh --version"
Status: CLOSED WORKSFORME
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 7.2p2
Hardware: Other Linux
: P5 enhancement
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-07 18:38 AEDT by jg
Modified: 2021-04-23 14:56 AEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jg 2017-03-07 18:38:08 AEDT
I am using
ssh -V
OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g  1 Mar 2016


Would you support a patch to add "ssh --version" this is the standard way to check the version, it is unclear what version ssh from the help output, so could add it to that as well. If there was agreement.

$ ssh
usage: ssh [-1246AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
           [-D [bind_address:]port] [-E log_file] [-e escape_char]
           [-F configfile] [-I pkcs11] [-i identity_file] [-L address]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-Q query_option] [-R address] [-S ctl_path] [-W host:port]
           [-w local_tun[:remote_tun]] [user@]hostname [command]


I would suggest adding the version to this output as well. And also --version command line on the parameters
Comment 1 Darren Tucker 2017-03-07 19:41:10 AEDT
(In reply to jg from comment #0)
> Would you support a patch to add "ssh --version" this is the
> standard way

--version (and long options in general) are not standard (see http://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html), they're a GNU extension.

So, no, probably not.
Comment 2 jg 2017-03-09 17:13:42 AEDT
I appreciate that GNU long options aren't part of POSIX, but when they are so common, is it not worth being GNU compatible now?

The other question, is could the usage be updated to include the current version? eg

$ ssh
 OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g  1 Mar 2016
usage: ssh [-1246AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
           [-D [bind_address:]port] [-E log_file] [-e escape_char] [-V]
           [-F configfile] [-I pkcs11] [-i identity_file] [-L address]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-Q query_option] [-R address] [-S ctl_path] [-W host:port]
           [-w local_tun[:remote_tun]] [user@]hostname [command]
Comment 3 Darren Tucker 2017-03-10 13:33:08 AEDT
(In reply to jg from comment #2)
> I appreciate that GNU long options aren't part of POSIX, but when
> they are so common, is it not worth being GNU compatible now?

No.

> The other question, is could the usage be updated to include the
> current version? eg

It's not relevant to the usage, so probably not.

Thanks for the suggestions but they are not something we are interested in implementing at this time.
Comment 4 Damien Miller 2021-04-23 14:56:27 AEST
closing resolved bugs as of 8.6p1 release