[Pkg-wmaker-commits] [wmacpi] 09/105: wmacpi: Bump to version 1.99r1.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Tue Aug 18 01:13:39 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmacpi.

commit cac390607736822ab976436702c5dc19b6b5a517
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date:   Mon Aug 18 17:56:15 2014 -0500

    wmacpi: Bump to version 1.99r1.
    
    Source obtained from http://sourceforge.net/projects/wmacpi/files/.
---
 README    |  4 ++--
 acpi.c    |  6 +++---
 libacpi.h |  4 ++--
 wmacpi.c  | 23 +++++++++++++++--------
 4 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/README b/README
index 409f8b8..97fcb19 100644
--- a/README
+++ b/README
@@ -19,7 +19,7 @@ under /proc/acpi, reads status information from them, and then
 displays summaries.
 
 Version 1.99 and later provides full support for multiple
-batteries. You can tell it to monitor a particular batter with the -m
+batteries. You can tell it to monitor a particular battery with the -m
 option, which will display the percentage remaining and current status
 message for that battery. The time remaining and AC/battery status are
 global - the time remaining is calculated based on all batteries found
@@ -51,4 +51,4 @@ this could have adverse effects.
 
 Please report bugs to <simon at dreamcraft.com.au>.
 
-Simon Fowler, 2003-11-23.
\ No newline at end of file
+Simon Fowler, 2003-11-23.
diff --git a/acpi.c b/acpi.c
index 2bb0935..23649fb 100644
--- a/acpi.c
+++ b/acpi.c
@@ -71,11 +71,11 @@ int main(int argc, char *argv[])
 			if(optarg != NULL) {
 				samples = atoi(optarg);
 				if(samples > 1000 || samples <= 0) {
-					printf("Please specify a reasonable number of samples\n");
+					fprintf(stderr, "Please specify a reasonable number of samples\n");
 					exit(1);
+				}
 			}
-			}
-			printf("samples: %d\n", samples);
+			pinfo("samples: %d\n", samples);
 			sleep_time = 1000000/samples;
 			break;
 		default:
diff --git a/libacpi.h b/libacpi.h
index 4ed6f5a..2ba7cc8 100644
--- a/libacpi.h
+++ b/libacpi.h
@@ -96,8 +96,6 @@ typedef struct {
  * It's a macro because I'm too lazy to deal with varargs.
  */
 
-static int verbosity = 0;
-
 #define pdebug(fmt, arg...)				\
     do {						\
 	if (verbosity > 2)				\
@@ -124,6 +122,8 @@ static int verbosity = 0;
 battery_t batteries[MAXBATT];
 int batt_count;
 
+int verbosity;
+
 /* check if apm/acpi is enabled, etc */
 int power_init(void);
 /* fill global_t with data */
diff --git a/wmacpi.c b/wmacpi.c
index 158f514..96c6df3 100644
--- a/wmacpi.c
+++ b/wmacpi.c
@@ -63,6 +63,7 @@ typedef struct {
 Dockapp *dockapp;
 global_t *globals;
 int count = 0;			/* global timer variable */
+/* extern int verbosity; */
 
 /* Time for scroll updates */
 #define DEFAULT_UPDATE 150
@@ -584,13 +585,19 @@ void set_batt_id_area(int bno)
 
 void usage(char *name)
 {
-    printf("%s - help\t\t[timecop at japan.co.jp]\n\n"
+    printf("%s - help\t\t[simon at dreamcraft.com.au]\n\n"
 	   "-d display\t\tdisplay on remote display <display>\n"
 	   "-b\t\t\tmake noise when battery is critical low (beep)\n"
 	   "-c value\t\tset critical low alarm at <value> percent\n"
 	   "\t\t\t(default: 10 percent)\n"
 	   "-m <battery number>\tbattery number to monitor\n"
-	   "-v\t\t\tincrease verbosity.\n"
+	   "-s <sample rate>\trate at which to sample battery status\n"
+	   "\t\t\tdefault 100 (once every three seconds)\n"
+	   "-n\t\t\tdo not blink\n"
+	   "-w\t\t\trun in command line mode\n"
+	   "-a <samples>\t\tsamples to average over (cli mode only)\n"
+	   "-v\t\t\tincrease verbosity\n"
+	   "\t\t\tcan be used multiple times to increase verbosity further\n"
 	   "-h\t\t\tdisplay this help\n",
 	   name);
 }
@@ -664,11 +671,6 @@ int main(int argc, char **argv)
     globals->crit_level = 10;
     battery_no = 1;
 
-    /* see if whatever we want to use is supported */
-    if (power_init())
-	/* power_init functions handle printing error messages */
-	exit(1);
-
     /* parse command-line options */
     while ((ch = getopt(argc, argv, "d:c:m:s:a:hnwvV")) != EOF) {
 	switch (ch) {
@@ -731,7 +733,7 @@ int main(int argc, char **argv)
 	    if(optarg != NULL) {
 		samples = atoi(optarg);
 		if(samples > 1000 || samples <= 0) {
-		    printf("Please specify a reasonable number of samples\n");
+		    fprintf(stderr, "Please specify a reasonable number of samples\n");
 		    exit(1);
 		}
 	    }
@@ -743,6 +745,11 @@ int main(int argc, char **argv)
 	
     }
     
+    /* see if whatever we want to use is supported */
+    if (power_init())
+	/* power_init functions handle printing error messages */
+	exit(1);
+
     /* check for cli mode */
     if (cli) {
 	cli_wmacpi(samples);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmacpi.git



More information about the Pkg-wmaker-commits mailing list