Why doesn't the VM command line help show the useful image commands anymore?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Why doesn't the VM command line help show the useful image commands anymore?

Tim Mackinnon
I was asked a question about starting pharo exercism from the command line on Arch linux - seems the Pharo.image file isn’t being found (but it was installed with AUR, which I am unfamiliar with).

Anyway - I tried using the command line on OSX ( I noticed they had used pharo, and not pharo-ui — which I never understood: why is it not pharo for ui and pharo-cmd for terminal, as it burns most people?) - and typed “pharo —help”, and you get an impressive long list of commands - however it doesn’t show you the useful Image commands anymore? So you would never know to use “pharo Pharo.image —list”.

 A while back it showed you that - but its now gone which seems a shame?

I also notice at the bottom of the list, its says the the image name defaults to Pharo.image - however I haven’t noticed that works at all - you have to specify an image, so thats a bit misleading.

Tim


Reply | Threaded
Open this post in threaded view
|

Re: Why doesn't the VM command line help show the useful image commands anymore?

Sven Van Caekenberghe-2


> On 30 Apr 2019, at 00:05, Tim Mackinnon <[hidden email]> wrote:
>
> I was asked a question about starting pharo exercism from the command line on Arch linux - seems the Pharo.image file isn’t being found (but it was installed with AUR, which I am unfamiliar with).
>
> Anyway - I tried using the command line on OSX ( I noticed they had used pharo, and not pharo-ui — which I never understood: why is it not pharo for ui and pharo-cmd for terminal, as it burns most people?) - and typed “pharo —help”, and you get an impressive long list of commands - however it doesn’t show you the useful Image commands anymore? So you would never know to use “pharo Pharo.image —list”.
>
> A while back it showed you that - but its now gone which seems a shame?

I don't believe that it ever worked that way: as it is now the VM can only answer for his part, while the commands that are handled by the image can only document themselves.

Yes, this could be improved.

The pharo-ui vs pharo depends on your standpoint: I like the shorter one for the command line.

We should not rename them, by join them, if that would be possible.  

> I also notice at the bottom of the list, its says the the image name defaults to Pharo.image - however I haven’t noticed that works at all - you have to specify an image, so thats a bit misleading.
>
> Tim
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Why doesn't the VM command line help show the useful image commands anymore?

K K Subbu
In reply to this post by Tim Mackinnon
On 30/04/19 3:35 AM, Tim Mackinnon wrote:

> Anyway - I tried using the command line on OSX ( I noticed they had
> used pharo, and not pharo-ui — which I never understood: why is it
> not pharo for ui and pharo-cmd for terminal, as it burns most
> people?) - and typed “pharo —help”, and you get an impressive long
> list of commands - however it doesn’t show you the useful Image
> commands anymore? So you would never know to use “pharo Pharo.image
> —list”.
>
> A while back it showed you that - but its now gone which seems a
> shame?

$ pharo --help

will pass the option --help to the VM, not the virtual image. You have
to "Precede <arguments> by '--' to terminate VM options and begin the
virtual image and its options.

$ pharo -- --list

will pass the --list to the default image - ${PHARO_IMAGE:-Pharo.image}

> I also notice at the bottom of the list, its says the the image name
> defaults to Pharo.image - however I haven’t noticed that works at all
> - you have to specify an image, so thats a bit misleading.
>
$ PHARO_IMAGE=Pharo.image ./pharo -- eval 3+4
7
$ PHARO_IMAGE=Pharo.image ./pharo -- --help
Usage: [<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
       
        Preference File Modification:
        --preferences-file   load the preferences from the given <FILE>
        --no-default-preferences    do not load any preferences from the
default locations
       
Documentation:
A PharoCommandLineHandler handles default command line arguments and
options.
The PharoCommandLineHandler is activated before all other handlers.
It first checks if another handler is available. If so it will activate
the found handler.

$ PHARO_IMAGE=Pharo.image ./pharo -- --list
Currently installed Command Line Handlers:
     Fuel            Loads fuel files
     config          Install and inspect Metacello Configurations from
the command line
     save            Rename the image and changes file
     update          Load updates
     printVersion    Print image version
     st              Loads and executes .st source files
     test            A command line test runner
     clean           Run image cleanup
     get             Install catalog projects from the command line
(consult catalog at http://catalog.pharo.org)
     eval            Directly evaluates passed in one line scripts

HTH .. Subbu

Reply | Threaded
Open this post in threaded view
|

Re: Why doesn't the VM command line help show the useful image commands anymore?

Tim Mackinnon
Subbu - I didn’t understand your point? How would I know to do pharo -- --list , by looking at the output of —help? (And in fact that doesn’t work on OSX, it prompts me for an image - thus reinforcing my point that the default image doesn’t appear to work, at least not in osx).

I swear a year or two ago, help told you how to do this? As it is now, a new user would have no clue - I think it would be helpful if the vm —help suggested you try “pharo <name.image> —help” for further image based parameters. (And all cog users agreed to support —help in images so that this message was true).

Tim

> On 30 Apr 2019, at 09:21, K K Subbu <[hidden email]> wrote:
>
> On 30/04/19 3:35 AM, Tim Mackinnon wrote:
>> Anyway - I tried using the command line on OSX ( I noticed they had
>> used pharo, and not pharo-ui — which I never understood: why is it
>> not pharo for ui and pharo-cmd for terminal, as it burns most
>> people?) - and typed “pharo —help”, and you get an impressive long
>> list of commands - however it doesn’t show you the useful Image
>> commands anymore? So you would never know to use “pharo Pharo.image
>> —list”.
>> A while back it showed you that - but its now gone which seems a
>> shame?
>
> $ pharo --help
>
> will pass the option --help to the VM, not the virtual image. You have to "Precede <arguments> by '--' to terminate VM options and begin the virtual image and its options.
>
> $ pharo -- --list
>
> will pass the --list to the default image - ${PHARO_IMAGE:-Pharo.image}
>
>> I also notice at the bottom of the list, its says the the image name
>> defaults to Pharo.image - however I haven’t noticed that works at all
>> - you have to specify an image, so thats a bit misleading.
> $ PHARO_IMAGE=Pharo.image ./pharo -- eval 3+4
> 7
> $ PHARO_IMAGE=Pharo.image ./pharo -- --help
> Usage: [<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
>
> Preference File Modification:
> --preferences-file   load the preferences from the given <FILE>
> --no-default-preferences    do not load any preferences from the default locations
>
> Documentation:
> A PharoCommandLineHandler handles default command line arguments and options.
> The PharoCommandLineHandler is activated before all other handlers.
> It first checks if another handler is available. If so it will activate the found handler.
>
> $ PHARO_IMAGE=Pharo.image ./pharo -- --list
> Currently installed Command Line Handlers:
>    Fuel            Loads fuel files
>    config          Install and inspect Metacello Configurations from the command line
>    save            Rename the image and changes file
>    update          Load updates
>    printVersion    Print image version
>    st              Loads and executes .st source files
>    test            A command line test runner
>    clean           Run image cleanup
>    get             Install catalog projects from the command line (consult catalog at http://catalog.pharo.org)
>    eval            Directly evaluates passed in one line scripts
>
> HTH .. Subbu
>


Reply | Threaded
Open this post in threaded view
|

Re: Why doesn't the VM command line help show the useful image commands anymore?

K K Subbu
On 30/04/19 6:14 PM, Tim Mackinnon wrote:
> Subbu - I didn’t understand your point? How would I know to do pharo
> -- --list , by looking at the output of —help? (And in fact that
> doesn’t work on OSX, it prompts me for an image - thus reinforcing my
> point that the default image doesn’t appear to work, at least not in
> osx).

Tim, I don't have access to Mac OSX :-(.

The usage text is printed in lines 296-301 in

https://github.com/pharo-project/pharo-vm/blob/master/opensmalltalk-vm/platforms/Mac%20OS/vm/sqMacUnixCommandLineInterface.c

If you don't see the same usage message, then it is a bug, possibly a
missing macro def in the build script.

The platform startup code on Mac and Linux are similar. They both parse
args for option words starting with single or double hyphens until a
word which matches "*.image" or "--" is seen. Rest of the words are
treated as a image (optional) and its arguments.

Regards .. Subbu