<div dir="ltr">I&#39;m not sure if you&#39;re referring to the optstring for getopt(3) or the program operands, but neither are required. You should specify your optstring in a way that won&#39;t error if no options are supplied.<div><br></div><div>getopt(3) doesn&#39;t process the operands; just the command line switches. That&#39;s why, after getopt(3) is done, you need to decrement argc, and increment argv to get the proper starting point of the operands.</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Oct 13, 2017 at 11:11 AM mseaton &lt;<a href="mailto:mseaton@stevens.edu">mseaton@stevens.edu</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I understand setting opterr to zero means that getopt will not report an<br>
error if no argument is entered, but our options must be able to work in<br>
both cases, however it still does not allow the program to continue if<br>
no argument is entered.<br>
<br>
Is there something I am missing?<br>
Thanks<br>
_______________________________________________<br>
cs631apue mailing list<br>
<a href="mailto:cs631apue@lists.stevens.edu" target="_blank">cs631apue@lists.stevens.edu</a><br>
<a href="https://lists.stevens.edu/mailman/listinfo/cs631apue" rel="noreferrer" target="_blank">https://lists.stevens.edu/mailman/listinfo/cs631apue</a><br>
</blockquote></div><div dir="ltr">-- <br></div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Jason Ajmo</div><div>Stevens Institute of Technology</div><div>B.S. Cybersecurity &#39;17</div><div>M.S. Computer Science &#39;18</div><div>0x56FA3123</div></div></div>