[Toybox] [RFC] New toy: acpi

Rob Landley rob at landley.net
Mon Sep 9 09:39:23 PDT 2013


On 09/04/2013 10:10:18 PM, Isaac wrote:
> I got tired of trying to guess how much terminal time I could get in  
> on my
> phone.
> So here's a basic acpi. I could probably add -c fairly easily
> (print type, cur_state, and max_state)
> -t is more difficult, since temperatures are reported in at least
> 1000 * degrees F and 10 * degrees C.
> 
> I would like to hear if any part of the design needs work.

Applied, and put straight into toys/other because it's small/simple  
enough to clean up in one sitting.

Whitespace changes all over the place. Curly brackets and blank lines  
and wordwrapping (oh my!)...

(I have now just totally confused the portion of the audience which has  
english as a second language. It's a reference to 1939 movie The Wizard  
Of Oz.)

Reshuffling so the declarations are at the start of blocks. I know c99  
allows them to be all over the place, but I prefer to have them in one  
place (and put a blank line after them).

Using readall() and checking the return code. _Probably_ won't have a  
problem, but just in case...

You print out battery if -b or no flags, but adapter is only if given  
-a (and not no flags). I'm assuming this is intentional, but happy to  
take a patch if it's not?

Rob
 1378744763.0


More information about the Toybox mailing list