Agree. I open a bug: https://pharo.fogbugz.com/f/cases/17378/Improve-command-line-handler-documen... that improve the doc. I propose: Usage: [--no-preferences|--preference-file=<FILE>][--help|--list|--copyright|--version|--no-quit|<subcommand> <subcommand args>] --help print this help message --list list a description of all active command line handlers --copyright print the copyrights --version print the version for the image and the vm --no-quit keep the image running without activating any other command line handler <subcommand> a valid subcommand in --list <subcommand> --help show subcommand help Vincent
-----Message d'origine----- De : Pharo-dev [mailto:pharo-dev-bounces@lists.pharo.org] De la part de Sven Van Caekenberghe Envoyé : mardi 12 janvier 2016 11:48 à : Pharo Development List Objet : Re: [Pharo-dev] Pharo50 spur works on CentOS?
No, I don't think so, it has a function.
Some people like to configure Pharo images so that they have a running server inside them. In that case, starting your app is a simple as starting the image, but you would probably need the --no-quit to prevent it from exiting immediately.
(I personally don't like and never use that approach, but I know some people like it).
The confusing aspect is that the same option is used in two places and the first one annihilates the second. But that is documented:
prometheus:pharo5 sven$ ./pharo Pharo.image --help Usage: [--no-preferences|--preference-file=<FILE>][<subcommand>] [-- help] [--copyright] [--version] [--list] [ --no-quit ] --help print this help message --copyright print the copyrights --version print the version for the image and the vm --list list a description of all active command line handlers --no-quit keep the image running without activating any other command line handler <subcommand> a valid subcommand in --list
Documentation: A BasicCommandLineHandler handles default command line arguments and options.
It clearly says "without activating any other command line handler". So using --no-quit BEFORE the subcommand annihilates the subcommand (AFAIU).
On 12 Jan 2016, at 11:28, Blondeau Vincent <vincent.blondeau@worldline.com> wrote:
So --no-quit should be removed from the default line handler?
Vincent
-----Message d'origine----- De : Pharo-dev [mailto:pharo-dev-bounces@lists.pharo.org] De la part de Esteban Lorenzano Envoyé : mardi 12 janvier 2016 11:18 à : Pharo Development List Objet : Re: [Pharo-dev] Pharo50 spur works on CentOS?
But you cannot use it as a general command. If you use a subcommand (most likely) then you do not have it unless the subcommand defines it.
Esteban
On 12 Jan 2016, at 11:12, Blondeau Vincent <vincent.blondeau@worldline.com> wrote:
-----Message d'origine----- De : Pharo-dev [mailto:pharo-dev-bounces@lists.pharo.org] De la part de Sven Van Caekenberghe Envoyé : mardi 12 janvier 2016 10:57 à : Pharo Development List Objet : Re: [Pharo-dev] Pharo50 spur works on CentOS?
On 12 Jan 2016, at 10:50, Esteban Lorenzano <estebanlm@gmail.com> wrote:
On 12 Jan 2016, at 10:34, Sven Van Caekenberghe <sven@stfx.eu> wrote:
On 12 Jan 2016, at 10:28, Blondeau Vincent <vincent.blondeau@worldline.com> wrote:
Indeed, it works. Thanks!
But the command line usage is not clear : ./pharo Pharo.image Usage: [--no-preferences|--preference- file=<FILE>][<subcommand>] [--help] [--copyright] [--version] [--list] [ --no-quit ]
Maybe, it can be : Usage: [--no-preferences|--preference- file=<FILE>][<subcommand>] [--help] [--copyright] [--version] [--list] [ --no-quit ] [<subcommand args>]
Moreover, an option can usually be placed anywhere on the command line, shouldn't it? Or at least it should raise an error?
Yes it is a bit confusion (but you could try to read/understand the Pharo code, it is not very difficult ;-)
But the idea is that the sub-command controls its own options (like passing linker options via the compiler to the linker - git also has global and per sub command options, no ?)
--no-quit probably also works for the default command ... (I haven't looked), so at that point, the option is consumed already.
No, it doesn't :)
prometheus:pharo5 sven$ ./pharo Pharo.image printVersion [version] 5.0 #50510 prometheus:pharo5 sven$ ./pharo Pharo.image --no-quit ^C
The last command 'hangs' (i.e. the image keeps running, just as advertised). So the default (Pharo, subclass of BasicCommandHandler) interpreted the -- no-quit and acted upon it. No ?
Yes! See: BasicCommandLineHandler>>handleArgument:
Vincent
Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité de Worldline ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être recherchée pour tout dommage résultant d'un virus transmis.
This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Worldline liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.
Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité de Worldline ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être recherchée pour tout dommage résultant d'un virus transmis. This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Worldline liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.