changed help/version output
This commit is contained in:
parent
6d990a5772
commit
effa82793f
1 changed files with 49 additions and 53 deletions
102
main.cc
102
main.cc
|
|
@ -130,50 +130,55 @@ static void assemble_regexp_predicate(std::string& predicate_string,
|
||||||
predicate_string += ")/";
|
predicate_string += ")/";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void show_version(std::ostream& out)
|
||||||
|
{
|
||||||
|
out
|
||||||
|
<< "Ledger " << ledger::version << ", the command-line accounting tool\n\n"
|
||||||
|
<< "Copyright (c) 2003-2004, New Artisans LLC. All rights reserved.\n\n"
|
||||||
|
<< "This program is made available under the terms of the BSD Public\n"
|
||||||
|
<< "License. See the LICENSE file included with the distribution for\n"
|
||||||
|
<< "details and disclaimer.\n";
|
||||||
|
}
|
||||||
|
|
||||||
static void show_help(std::ostream& out)
|
static void show_help(std::ostream& out)
|
||||||
{
|
{
|
||||||
std::cerr
|
out
|
||||||
<< "usage: ledger [options] COMMAND [options] [REGEXPS]" << std::endl
|
<< "usage: ledger [options] COMMAND [options] [REGEXPS]\n\n"
|
||||||
<< std::endl
|
<< "Basic options:\n"
|
||||||
<< "Basic options:" << std::endl
|
<< " -h display this help text\n"
|
||||||
<< " -h display this help text" << std::endl
|
<< " -v display version information\n"
|
||||||
<< " -v display version information" << std::endl
|
<< " -f FILE specify pathname of ledger data file\n\n"
|
||||||
<< " -f FILE specify pathname of ledger data file" << std::endl
|
<< "Report filtering:\n"
|
||||||
<< std::endl
|
<< " -a REGEX specify an account regex for \"print\"\n"
|
||||||
<< "Report filtering:" << std::endl
|
<< " -b DATE specify a beginning date\n"
|
||||||
<< " -a REGEX specify an account regex for \"print\"" << std::endl
|
<< " -e DATE specify an ending date\n"
|
||||||
<< " -b DATE specify a beginning date" << std::endl
|
<< " -c do not show future entries (same as -e TODAY)\n"
|
||||||
<< " -e DATE specify an ending date" << std::endl
|
<< " -d DATE specify a date mask ('-d mon', for all mondays)\n"
|
||||||
<< " -c do not show future entries (same as -e TODAY)" << std::endl
|
<< " -C show only cleared transactions and balances\n"
|
||||||
<< " -d DATE specify a date mask ('-d mon', for all mondays)" << std::endl
|
<< " -U show only uncleared transactions and balances\n"
|
||||||
<< " -C show only cleared transactions and balances" << std::endl
|
<< " -R do not consider virtual transactions: real only\n"
|
||||||
<< " -U show only uncleared transactions and balances" << std::endl
|
<< " -l EXPR don't print entries for which EXPR yields 0\n\n"
|
||||||
<< " -R do not consider virtual transactions: real only" << std::endl
|
<< "Customizing output:\n"
|
||||||
<< " -l EXPR don't print entries for which EXPR yields 0" << std::endl
|
<< " -n do not calculate parent account totals\n"
|
||||||
<< std::endl
|
<< " -s show sub-accounts in balance, and splits in register\n"
|
||||||
<< "Customizing output:" << std::endl
|
<< " -M print register using monthly sub-totals\n"
|
||||||
<< " -n do not calculate parent account totals" << std::endl
|
<< " -E show accounts that total to zero\n"
|
||||||
<< " -s show sub-accounts in balance, and splits in register" << std::endl
|
<< " -S EXPR sort entry output based on EXPR\n\n"
|
||||||
<< " -M print register using monthly sub-totals" << std::endl
|
<< "Commodity prices:\n"
|
||||||
<< " -E show accounts that total to zero" << std::endl
|
<< " -T report commodity totals, not their market value\n"
|
||||||
<< " -S EXPR sort entry output based on EXPR" << std::endl
|
<< " -B report cost basis of commodities\n"
|
||||||
<< std::endl
|
<< " -V report the market value of commodities\n"
|
||||||
<< "Commodity prices:" << std::endl
|
<< " -P FILE sets the price database, for reading/writing price info\n"
|
||||||
<< " -T report commodity totals, not their market value" << std::endl
|
<< " -Q download price information from the Internet\n"
|
||||||
<< " -B report cost basis of commodities" << std::endl
|
<< " (works by running \"getquote SYMBOL\")\n"
|
||||||
<< " -V report the market value of commodities" << std::endl
|
<< " -L MINS with -Q, fetch quotes only if data is older than MINS\n"
|
||||||
<< " -P FILE sets the price database, for reading/writing price info" << std::endl
|
<< " -p STR specifies a direct commodity conversion: COMM=AMOUNT\n\n"
|
||||||
<< " -Q download new price information (when needed) from the Internet" << std::endl
|
<< "Commands:\n"
|
||||||
<< " (works by running \"getquote SYMBOL\")" << std::endl
|
<< " balance show balance totals\n"
|
||||||
<< " -L MINS with -Q, fetch quotes only if data is older than MINS" << std::endl
|
<< " register display a register for ACCOUNT\n"
|
||||||
<< " -p STR specifies a direct commodity conversion: COMM=AMOUNT" << std::endl
|
<< " print print all ledger entries\n"
|
||||||
<< std::endl
|
<< " entry output a newly formed entry, based on arguments\n"
|
||||||
<< "commands:" << std::endl
|
<< " equity output equity entries for specified accounts\n";
|
||||||
<< " balance show balance totals" << std::endl
|
|
||||||
<< " register display a register for ACCOUNT" << std::endl
|
|
||||||
<< " print print all ledger entries" << std::endl
|
|
||||||
<< " entry output a newly formed entry, based on arguments" << std::endl
|
|
||||||
<< " equity output equity entries for specified accounts" << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char * argv[])
|
int main(int argc, char * argv[])
|
||||||
|
|
@ -260,16 +265,7 @@ int main(int argc, char * argv[])
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case 'v':
|
case 'v':
|
||||||
std::cout
|
show_version(std::cout);
|
||||||
<< "Ledger " << version
|
|
||||||
<< ", the command-line accounting tool" << std::endl
|
|
||||||
<< " Copyright (c) 2003-2004, New Artisans LLC. All rights reserved."
|
|
||||||
<< std::endl << std::endl
|
|
||||||
<< "This program is made available under the terms of the BSD Public"
|
|
||||||
<< std::endl
|
|
||||||
<< "License. See the LICENSE file included with the distribution for"
|
|
||||||
<< std::endl
|
|
||||||
<< "details and disclaimer." << std::endl;
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case 'f':
|
case 'f':
|
||||||
|
|
@ -447,7 +443,7 @@ int main(int argc, char * argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (optind == argc) {
|
if (optind == argc) {
|
||||||
show_help(std::cout);
|
show_help(std::cerr);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue