Return-Path: william@bourbon.usc.edu Delivery-Date: Sun Sep 7 14:22:32 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m87LMWpT011713 for ; Sun, 7 Sep 2008 14:22:32 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m87LLLbT018922 for ; Sun, 7 Sep 2008 14:21:21 -0700 Message-Id: <200809072121.m87LLLbT018922@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Command line input Date: Sun, 07 Sep 2008 14:21:21 -0700 From: Bill Cheng Someone wrote: > I thought that the optional command line arguments can be entered in any > order. In that case, would a command like > > server [-m] [-d seconds] [-t seconds] port > > also produce an illegal command line argument error message ? Given that "optional command line arguments can be entered in any order", could you tell me what is the difference between what you've written and: server [-t seconds] [-d delay] [-m] port -- Bill Cheng // bill.cheng@usc.edu On Sun, Sep 7, 2008 at 8:09 AM, Bill Cheng wrote: > Someone wrote: > > > for the warmup project # 1 of cs551, in case of command line inputs, do > we > > have to validate only the cases mentioned in the project grading > guidelines > > or all possible cases ? > > > > for eg: for server , if server -t -m 12345 is typed on the command line, > its > > an error but this case isnt considered in the grading guidelines. > > I think you misunderstood what the commandline syntax is > about. For the server, the commandline syntax is: > > server [-t seconds] [-d delay] [-m] port > > This is not an example. This specifies *exactly* what the > commandline syntax is! So, if the user gives something > *incorrect*, you should not run the server and tell the user > why the commandline syntax is violated. > > You should not try to enumerate all possible form the > commandline can take. You should parse the commandline > argument in a reasonable way. Please go to the web and look > for examples. > -- > Bill Cheng // bill.cheng@usc.edu