<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>IIABDFI</div><div id="AppleMailSignature">Esteban rewrote the code that use -- for Pharo, preserving - for Squeak. What's the problem??<br><br><span style="background-color: rgba(255, 255, 255, 0);">_,,,^..^,,,_ (phone)</span></div><div><br>On May 7, 2017, at 8:50 AM, Ben Coman <<a href="mailto:notifications@github.com">notifications@github.com</a>> wrote:<br><br></div><blockquote type="cite"><div><p><b>@bencoman</b> requested changes on this pull request.</p>
<p>Can we have some discussion on [vm-dev] about the flexibility of Squeakers to use double-hyphen options as default?</p><hr>
<p>In <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/136#discussion_r115144594">platforms/unix/vm/sqUnixMain.c</a>:</p>
<pre style="color:#555">> @@ -1467,7 +1464,8 @@ static int vm_parseArgument(int argc, char **argv)
/* vm arguments */
- if (!strcmp(argv[0], VMOPTION("help"))) { usage(); return 1; }
+ if (!strcmp(argv[0], VMOPTION("help"))) { usage(0); /*NOTREACHED*/}
</pre>
<p>Would it be better to shift the exit() out of usage(), so that real code affection execution flow is used here rather than a comment. i.e. here... { usage(); exit(0) } ??</p>
<hr>
<p>In <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/136#discussion_r115146241">platforms/unix/vm/sqUnixMain.c</a>:</p>
<pre style="color:#555">> @@ -1721,7 +1719,7 @@ static void usage(void)
printf("\nAvailable drivers:\n");
for (m= modules; m->next; m= m->next)
printf(" %s\n", m->name);
- exit(1);
+ exit(exitValue);
</pre>
<p>Refactor the exit() out to the caller ??</p>
<hr>
<p>In <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/136#discussion_r115146279">platforms/unix/vm/sqUnixMain.c</a>:</p>
<pre style="color:#555">> @@ -1819,7 +1817,8 @@ static void parseArguments(int argc, char **argv)
if (n == 0) /* option not recognised */
{
fprintf(stderr, "unknown option: %s\n", argv[0]);
- usage();
+ usage(1);
+ /*NOTREACHED*/
</pre>
<p>Same as above, refactor exit out of usage() ? i.e. here...<br>
usage();<br>
exit(1)</p>
<hr>
<p>In <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/136#discussion_r115146611">platforms/unix/vm/sqUnixMain.c</a>:</p>
<pre style="color:#555">> {
struct SqModule *m= 0;
printf("Usage: %s [<option>...] [<imageName> [<argument>...]]\n", argVec[0]);
printf(" %s [<option>...] -- [<argument>...]\n", argVec[0]);
+ printf("options begin with single -, but -- prefix is silently accepted\n");
</pre>
<p>The problem is that single-hyphen default is then what is advised by --help. Why isn't it preferable to conform to Unix conventions [1] "The GNU double-hyphen option leader was chosen so that traditional single-letter options and GNU-style keyword options could be unambiguously mixed on the same command line. "<br>
[1] <a href="http://www.catb.org/%7Eesr/writings/taoup/html/ch10s05.html">http://www.catb.org/~esr/writings/taoup/html/ch10s05.html</a></p>
<p>The single-hyphen could be silently accepted for backward compatibility. Maybe better would be a deprecated message, but perhaps that could adversely affect existing scripts(?).</p>
<p>How do Squeakers feel about that?</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>You are receiving this because you are subscribed to this thread.<br>Reply to this email directly, <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/136#pullrequestreview-36665772">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/APHa0J4-Fajekb-2AhuabMs8lPjziRoLks5r3ehRgaJpZM4NTEb1">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/APHa0B7i9nzqXrHn3yucDE0noIKNLRAjks5r3ehRgaJpZM4NTEb1.gif" width="1"></p>
<div itemscope="" itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope="" itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/136#pullrequestreview-36665772">
<meta itemprop="name" content="View Pull Request">
</div>
<meta itemprop="description" content="View this Pull Request on GitHub">
</div>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/OpenSmalltalk/opensmalltalk-vm","title":"OpenSmalltalk/opensmalltalk-vm","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm"}},"updates":{"snippets":[{"icon":"PERSON","message":"@bencoman requested changes on #136"}],"action":{"name":"View Pull Request","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/136#pullrequestreview-36665772"}}}</script></div></blockquote></body></html>