]> pd.if.org Git - zpackage/blobdiff - zpm-foreach-path.c
add error checks to foreach_path
[zpackage] / zpm-foreach-path.c
index 30340a022d4576dbfb3bfed7f8b7eedadf472a05..2403576f4941d12d4f72f4b22b361f4bb941734f 100644 (file)
@@ -24,7 +24,7 @@ struct config {
 };
 
 static void usage() {
-       printf("usage: ...\n");
+       printf("usage: zpm foreach-path [-fncC] args ...\n");
 }
 
 static int run_program(void *f, int ncols, char **vals, char **cols) {
@@ -200,10 +200,9 @@ int main(int ac, char **av){
        char *s;
        int opt;
 
-       struct config conf = { "/var/lib/db.zpm", 0, 0, 0, "", 0, 0, printpaths
+       struct config conf = { "/var/lib/zpm/local.db", 0, 0, 0, "", 0, 0, printpaths
        };
 
-
        if ((s = getenv("ZPMDB"))) {
                /* TODO does this need to be copied ? */
                conf.dbfile = s;
@@ -252,6 +251,7 @@ int main(int ac, char **av){
                argn++;
        } else {
                fprintf(stderr, "must specify pkgid\n");
+               usage();
                exit(EXIT_FAILURE);
        }