Menu

#441 Version information

open
nobody
None
5
2022-12-16
2022-12-16
Sam Tansy
No

In GNU coding standard for Command Line Interfaces there is an option that shows version helping user to recognise version of the program. Just as it accepts --help now it could accept --version.

hello 2.3
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Could you implement it to help distinguish program version.

It would be as simple as

7z 23.00
Copyright (c) 1999 Igor Pavlov
License: GNU Lesser General Public version 2.1 of the License
Parts of the software are in Public Domain, GNU LGPL with unRAR license restriction, BSD 3-clause License
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

As a side note - The program’s name should be a constant string; don’t compute it from argv[0]. The idea is to state the standard or canonical name for the program, not its file name.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.