On Fri, May 5, 2017 at 10:13 AM, K K Subbu <kksubbu.ml@gmail.com> wrote:
On Friday 05 May 2017 03:01 AM, Andrei Chis wrote:
Any thoughts or places where I can look? This problem is still in the latest vm.
Cheers, Andrei
On Thu, Mar 30, 2017 at 9:37 AM, Andrei Chis <chisvasileandrei@gmail.com <mailto:chisvasileandrei@gmail.com>> wrote:
Hi,
In an ubuntu installation with the latest vm and Pharo 6 image when executing `./pharo --help` I get an error code of 1. ... On mac the error code is 0. Also when executing './pharo' or './pharo Pharo.image --help' or './pharo --version' the error code is 0 on both mac and linux.
That is strange. The source code returns 1 for both unix and Mac:
-----platforms/Mac OS/vm/sqMacUnixCommandLineInterface.c ---- if (!strcmp(argv[0], "-help")) { usage(); return 1; } -----platform/unix/vm/sqUnixMain.c if (!strcmp(argv[0], VMOPTION("help"))) { usage(); return 1; } -------
BTW, the option is "-help" with a single dash. Two dashes will print the same because the option is not recognized. You may as well type "--hellllp" ;-).
Thanks for the info! It's actually a bit stranger. The option should be specified using '--' ./pharo -help unknown option: -help Common <option>s: --help print this help message, then exit Then `./pharo -help` returns an exit code of 1 on mac/linux while `./pharo --help` returns a exit code of 0 on mac and 1 on linux. I think this behaviour comes from [1] and [2]: ----platforms/unix/vm/sqUnixMain.c---- if (!strcmp(argv[0], VMOPTION("help"))) { usage(); return 1; } ----platforms/iOS/vm/OSX/sqSqueakOSXApplication.m---- if ([argData isEqualToString: VMOPTIONOBJ("help")]) { [self usage]; exit(0); return 1; } It's still not clear why running the vm to print the help of the version should exit with an error code. Cheers, Andrei [1] https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/b076561abada1884750d7... [2] https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/995e7aedc3b5aeb76904f...
Regards .. Subbu