From b982cab197a95ee327bc455ad0b895fdd61534b6 Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Tue, 26 Aug 2014 02:21:05 +0200 Subject: [PATCH] Add implicit values to program options. --- heaptrack_print.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/heaptrack_print.cpp b/heaptrack_print.cpp index cf7abc1..2170bfd 100644 --- a/heaptrack_print.cpp +++ b/heaptrack_print.cpp @@ -534,14 +534,22 @@ int main(int argc, char** argv) { po::options_description desc("Options"); desc.add_options() - ("file,f", po::value()->required(), "The heaptrack data file to print.") - ("shorten-templates,t", po::value()->default_value(true), "Shorten template identifiers.") - ("print-peaks,p", po::value()->default_value(true), "Print backtraces to top allocators, sorted by peak consumption.") - ("print-allocators,a", po::value()->default_value(true), "Print backtraces to top allocators, sorted by number of calls to allocation functions.") - ("print-leaks,l", po::value()->default_value(false), "Print backtraces to leaked memory allocations.") - ("print-histogram,H", po::value()->default_value(false), "Print allocation size histogram.") - ("print-overall-allocated,o", po::value()->default_value(false), "Print top overall allocators, ignoring memory frees.") - ("help,h", "Show this help message."); + ("file,f", po::value()->required(), + "The heaptrack data file to print.") + ("shorten-templates,t", po::value()->default_value(true)->implicit_value(true), + "Shorten template identifiers.") + ("print-peaks,p", po::value()->default_value(true)->implicit_value(true), + "Print backtraces to top allocators, sorted by peak consumption.") + ("print-allocators,a", po::value()->default_value(true)->implicit_value(true), + "Print backtraces to top allocators, sorted by number of calls to allocation functions.") + ("print-leaks,l", po::value()->default_value(false)->implicit_value(true), + "Print backtraces to leaked memory allocations.") + ("print-histogram,H", po::value()->default_value(false)->implicit_value(true), + "Print allocation size histogram.") + ("print-overall-allocated,o", po::value()->default_value(false)->implicit_value(true), + "Print top overall allocators, ignoring memory frees.") + ("help,h", + "Show this help message."); po::positional_options_description p; p.add("file", -1); -- 2.7.4