]> git.itanic.dy.fi Git - scan-pagemap/commitdiff
main: Set a reasonable default function if no arguments are given
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Thu, 29 Sep 2011 17:58:09 +0000 (20:58 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Thu, 29 Sep 2011 17:58:09 +0000 (20:58 +0300)
A very useful way to use scan-pagemap is to simply print out memory
usage of all processes on the system. Let this be the default behavior
of the program if no other options are given.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
main.c

diff --git a/main.c b/main.c
index 31fc8632d5c011c418fdd8363b7a26ea4951d2c9..10f1a9eb5c21e1ad4b5ee690b400a52ceffd1ce9 100644 (file)
--- a/main.c
+++ b/main.c
@@ -163,9 +163,8 @@ int main(int argc, char *argv[])
        read_args(argc, argv, &opts);
 
        if (argc < 2) {
-               printf("A pid or process name "
-                       "needs to be given as an argument\n");
-               print_help_and_die(argv[0]);
+               opts.parse_mask = PARSE_MAP_NAME;
+               opts.name = "";
        }
 
        clear_pageframe(&pf);