Recent

Author Topic: Bash commands to fetch "info version" included in an executable?  (Read 10338 times)

PascalDragon

  • Hero Member
  • *****
  • Posts: 5478
  • Compiler Developer
Re: Bash commands to fetch "info version" included in an executable?
« Reply #15 on: March 11, 2021, 08:58:57 am »
Even -h for help is far from universal, so, maybe just  --help and --version needs to be added. 

No. As marcov said, FPC is cross platform and not a Unix utility, we don't let the OS dictate us how we should handle parameters. Cause then on Windows or DOS we'd need to accept e.g. /? as well as that is what most utilities there use.

I wonder if the FPC includes a -- parser ?

No, cause it doesn't have any parameters with -- to handle.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11452
  • FPC developer.
Re: Bash commands to fetch "info version" included in an executable?
« Reply #16 on: March 11, 2021, 09:25:01 am »
And besides being a (unenforced) convention, the results are often not really machine readable, so pretty useless for nearly anything generic other then displaying the result in some window

E.g. linux "ls" doesn't respond to either -v or -V only to --version, but it is a GNU beast. (as can be readily seen as there is more facts about the license than anything useful)

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: Bash commands to fetch "info version" included in an executable?
« Reply #17 on: March 11, 2021, 09:32:38 am »
No. As marcov said, FPC is cross platform and not a Unix utility, we don't let the OS dictate us how we should handle parameters. Cause then on Windows or DOS we'd need to accept e.g. /? as well as that is what most utilities there use.

And what's wrong with that? Minimal handling of --version and --help (hence potentially of /? etc.) is a convention that's now at least 30 years old, and in both cases results in rapid termination of the program after minimal output: it's not as though it has to mess up the main command-line parser.

A command with no parameters at all though is application-specific.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

PascalDragon

  • Hero Member
  • *****
  • Posts: 5478
  • Compiler Developer
Re: Bash commands to fetch "info version" included in an executable?
« Reply #18 on: March 11, 2021, 01:42:12 pm »
No. As marcov said, FPC is cross platform and not a Unix utility, we don't let the OS dictate us how we should handle parameters. Cause then on Windows or DOS we'd need to accept e.g. /? as well as that is what most utilities there use.

And what's wrong with that? Minimal handling of --version and --help (hence potentially of /? etc.) is a convention that's now at least 30 years old, and in both cases results in rapid termination of the program after minimal output: it's not as though it has to mess up the main command-line parser.

As marcov said, not even ls adheres to that. So again, no we will not adjust that.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: Bash commands to fetch "info version" included in an executable?
« Reply #19 on: March 11, 2021, 02:15:15 pm »
As marcov said, not even ls adheres to that. So again, no we will not adjust that.

ls implements the conventional --version and --help options- or at least it does on the Debian systems I run. As I've already said, -v and -V have ALWAYS HAD at least as much claim to be interpreted as "verbose" as "version", and the habit of putting major.minor.fixes version numbers on just about everything didn't really take off until people noticed Linux's use of the convention.

And I don't for one moment expect you to change anything, and didn't say I did. That doesn't stop me from pointing out that FPC departs from a well-accepted convention.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

PascalDragon

  • Hero Member
  • *****
  • Posts: 5478
  • Compiler Developer
Re: Bash commands to fetch "info version" included in an executable?
« Reply #20 on: March 12, 2021, 03:52:30 pm »
And I don't for one moment expect you to change anything, and didn't say I did. That doesn't stop me from pointing out that FPC departs from a well-accepted convention.

It's a convention, not a requirement.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11452
  • FPC developer.
Re: Bash commands to fetch "info version" included in an executable?
« Reply #21 on: March 12, 2021, 04:28:16 pm »
As marcov said, not even ls adheres to that. So again, no we will not adjust that.

ls implements the conventional --version and --help options-

Afaik the long versions are not Unix but GNU specific. And as said  ls commonly used on Linux is a GNU product.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: Bash commands to fetch "info version" included in an executable?
« Reply #22 on: March 12, 2021, 04:55:42 pm »
As marcov said, not even ls adheres to that. So again, no we will not adjust that.

ls implements the conventional --version and --help options-

Afaik the long versions are not Unix but GNU specific. And as said  ls commonly used on Linux is a GNU product.

Correct. And as I've said- repeatedly I believe- it's a 30-year-old GNU convention found not only in Linux distreaux but also anywhere else the GNU utilities are available e.g. SunOS/Solaris.

I for one have certainly not suggested that FPC should abandon its existing options, and neither have I suggested that it should adopt -v for "version"... that would be an utterly barmy idea since as I have (repeatedly) pointed out -v has as much of a history of being used to indicate "verbose" as it has of indicating a request for version information.

But not having minimal handling of the --version and --help commands, even if the response was the same message saying how the user should be requesting more info, is ludicrous.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

PascalDragon

  • Hero Member
  • *****
  • Posts: 5478
  • Compiler Developer
Re: Bash commands to fetch "info version" included in an executable?
« Reply #23 on: March 15, 2021, 01:37:18 pm »
But not having minimal handling of the --version and --help commands, even if the response was the same message saying how the user should be requesting more info, is ludicrous.

Your opinion, but not that of us FPC devs.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: Bash commands to fetch "info version" included in an executable?
« Reply #24 on: March 15, 2021, 01:42:04 pm »
Your opinion, but not that of us FPC devs.

I know.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11452
  • FPC developer.
Re: Bash commands to fetch "info version" included in an executable?
« Reply #25 on: March 15, 2021, 02:08:43 pm »
Correct. And as I've said- repeatedly I believe- it's a 30-year-old GNU convention found not only in Linux distreaux but also anywhere else the GNU utilities are available e.g. SunOS/Solaris.

We don't have a commandline handler that does long options, and while it is theoretical possible to add it, the point is still why it is so important to warrant that, I haven't heard much more  than obtaining some hypothetical bullet point with Unix-in-principle-only software (which we are not) and an already debunked option for machine query of version info.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: Bash commands to fetch "info version" included in an executable?
« Reply #26 on: March 15, 2021, 02:30:39 pm »
We don't have a commandline handler that does long options, and while it is theoretical possible to add it, the point is still why it is so important to warrant that, I haven't heard much more  than obtaining some hypothetical bullet point with Unix-in-principle-only software (which we are not) and an already debunked option for machine query of version info.

I don't think that my shooting my mouth off about this any further is going to be particularly constructive.

I will, however round off by pointing out that FPC- which (AIUI) was for a long time oriented towards unix- happily adopts the unix convention of a single leading dash indicating an option as distinct from (for example) a Windows-style / or the rarely-seen convention of using +- for turning options on or off.

My sole point is that most software- and this includes Lazarus- in the modern GNU-dominated environment responds intelligently to --version and --help. I am emphatically NOT suggesting that FPC should go out of its way to display "live" version and help information in response to those, merely that it should recognise the longstanding convention and react with a hint as to what options should be used to get introductory information.

And that really is my last word on the matter.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11452
  • FPC developer.
Re: Bash commands to fetch "info version" included in an executable?
« Reply #27 on: March 15, 2021, 02:33:59 pm »
FPC's origins are dos, not Unix.  Using variable switchchar was something that wasn't generally followed any more in those times, only Microsoft still did it afaik.

But it could be that it was a GNU binutils influence.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Bash commands to fetch "info version" included in an executable?
« Reply #28 on: March 15, 2021, 02:47:28 pm »
[...] the point is still why it is so important to warrant that, I haven't heard much more  than obtaining some hypothetical bullet point with Unix-in-principle-only software (which we are not) and an already debunked option for machine query of version info.

It's not important but it would be convenient, even if just for that portion of users that work mostly on *nix-like systems. When one is used to write: somecommand --help to get a quick view of supported options, having the command barf back with just:
Code: [Select]
Error: Illegal parameter: --help
Error: /usr/bin/ppcx64 returned an error exitcode
is a little disconcerting, until you remember it's just -? or -h

But if it's so difficult to add it then we'll shrug it away; there are certainly much more important issues to deal with. Though the message might be a little more helpful, like say adding: "Use -? or -h to see valid options" :)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

 

TinyPortal © 2005-2018