Re: [Toybox] Defect in Argument parsing for "#" and "-"

2012-07-04 Thread Rob Landley
On 07/03/2012 11:49 PM, Ashwini Sharma wrote: >> I can grab a third character (maybe %) for literal long. The tradeoff >> here is between generic behavior (which can share code) and precise >> behavior that does exactly what you want. Some things need suffixes, so >> I made everything accept suffix

Re: [Toybox] Defect in Argument parsing for "#" and "-"

2012-07-03 Thread Ashwini Sharma
On 7/4/12, Rob Landley wrote: > On 07/02/2012 10:05 PM, Ashwini Sharma wrote: >> Hi Rob, >> >> I was using '#' for accepting a integer parameter. As per the parsing >> logic >> you used function atolx(), for converting the string to long. This >> function assumes suffixes with the supplied string

Re: [Toybox] Defect in Argument parsing for "#" and "-"

2012-07-03 Thread Rob Landley
On 07/02/2012 10:05 PM, Ashwini Sharma wrote: > I had a case where depth of traversal was to be defined as cmdline argument. > Giving "kmgtpe" would return zero, whereas I wanted it to only > integers as argument and no alpha characters. By the way, that probably _is_ a bug. If you haven't seen a

Re: [Toybox] Defect in Argument parsing for "#" and "-"

2012-07-03 Thread Rob Landley
On 07/02/2012 10:05 PM, Ashwini Sharma wrote: > Hi Rob, > > I was using '#' for accepting a integer parameter. As per the parsing logic > you used function atolx(), for converting the string to long. This > function assumes suffixes with the supplied string. There are > possibilities that user ma

[Toybox] Defect in Argument parsing for "#" and "-"

2012-07-02 Thread Ashwini Sharma
Hi Rob, I was using '#' for accepting a integer parameter. As per the parsing logic you used function atolx(), for converting the string to long. This function assumes suffixes with the supplied string. There are possibilities that user may not want suffixes to be there, i.e. any alpha char in th