[Yum-devel] Option handling problems

Michael Stenner mstenner at linux.duke.edu
Fri Oct 8 18:33:46 UTC 2004


On Fri, Oct 08, 2004 at 07:32:38PM +1000, Menno Smits wrote:
> As suggested in the top of grabber.py, I'll implement throttle as a
> percentage value when used a fraction of bandwidth and make data rate
> values for bandwidth and throttle fairly friendly (eg. "10KBs", "50kbps"
> "10bs").
> 
> Any objections?

Not exactly an objection.  Allowing lots of units might get
confusing.  If you want to go that route, I suggest that you be strict
and clear about the syntax.  For example:

   Units MUST be either "B/s" (bytes per second) OR "bps" (bits per
   second), with an optional preceeding SI prefix ("k", "M", "G").
   The unit may optionally be separated from the number by whitespace,
   but there may NOT be whitespace between the prefix and unit.
   Case is significant.

     Legal:   10kbps, 10 kbps, 4MB/s
     Illegal: 10Kbps, 10 kBps, 4mb/s, 5M B/s

Frankly, you might be better off just saying it's always B/s and then
letting people just do:  1000000, 1M, etc.  People can divide by 8 on
their own and it will save a lot of confusion.

					-Michael
-- 
  Michael D. Stenner                            mstenner at ece.arizona.edu
  ECE Department, the University of Arizona                 520-626-1619
  1230 E. Speedway Blvd., Tucson, AZ 85721-0104                 ECE 524G



More information about the Yum-devel mailing list