Opened 17 years ago
Last modified 17 years ago
#1216 assigned enhancement
Request for -version option for all command-line executables
| Reported by: | Michael Wood-Vasey | Owned by: | welling |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | misc | Version: | |
| Severity: | major | Keywords: | |
| Cc: | welling, Paul Price |
Description
I would like to request for a
--version
option be added to all command-line executables in IPP. This could print out what is already printed out in the first few lines of running a lot of the executables. E.g.
pswarp --version
psLib trunk/psconfig@23595M from 60eb6cdc-a59c-4636-a4e0-dba66a9721fd, built Mar 30 2009, 14:01:48 with cfitsio-3.100 gsl-1.11 fftw-3.0.1 mysql-5.0.22 optimised without trace
psModules trunk/psconfig@23595M from 60eb6cdc-a59c-4636-a4e0-dba66a9721fd, b
uilt Mar 30 2009, 14:02:51 optimised without nebclient
psphot trunk/psconfig@23595M from 60eb6cdc-a59c-4636-a4e0-dba66a9721fd, built Mar 30 2009, 14:06:19 optimised with libkapa
ppStats trunk/psconfig@23595M from 60eb6cdc-a59c-4636-a4e0-dba66a9721fd, built Mar 30 2009, 14:06:03 optimised
pswarp trunk@23595 from 60eb6cdc-a59c-4636-a4e0-dba66a9721fd, built Mar 30 2009, 14:10:52 optimised
as is currently spit out. Although I think I would request that the order be reversed. Spit out version information for calling executable first and then trace down.
The priority would be the ones we use a lot like pswarp, psphot, ppSub, ppStack, etc., but also things like ppConfigDump and other lower-level routines.
Change History (2)
comment:1 by , 17 years ago
comment:2 by , 17 years ago
| Cc: | added |
|---|---|
| Owner: | changed from to |
| Severity: | blocker → major |
| Status: | new → assigned |
| Summary: | Requestion for --version option for all command-line executables → Request for -version option for all command-line executables |
I've fixed the IPP so the correct version numbers get into the build (the version number appropriate for the component, for the version number appropriate for psconfig).
Now we just have to put in the version flag handling for the executables. The version flag should be "-version" (only a single dash) for consistency with the other flags. Something like this should be inserted before the main argument parsing:
int argNum = psArgumentGet(argc, argv, "-version");
if (argNum) {
executableVersionPrint();
exit(PS_EXIT_SUCCESS);
}
where "executableVersionPrint()" should be replaced with the appropriate function for the executable (e.g., "ppImageVersionPrint()"). You're welcome to reverse the order the components are printed.
I gathered from our last meeting that Joel was doing this. Is that right?

To clarify. When an executable successfully runs it spits out version information. But it's not spit out when just running --help. Being able to say
pswarp --version
would be quite useful.