summaryrefslogtreecommitdiff
path: root/src/global.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/global.cc')
-rw-r--r--src/global.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/global.cc b/src/global.cc
index 26fa494f..e5972efd 100644
--- a/src/global.cc
+++ b/src/global.cc
@@ -239,6 +239,15 @@ option_t<global_scope_t> * global_scope_t::lookup_option(const char * p)
case 'd':
OPT(debug_);
break;
+ case 'f':
+ OPT(full_help);
+ break;
+ case 'h':
+ OPT_(help);
+ else OPT(help_calc);
+ else OPT(help_comm);
+ else OPT(help_disp);
+ break;
case 'i':
OPT(init_file_);
break;
@@ -455,6 +464,25 @@ void global_scope_t::normalize_report_options(const string& verb)
}
}
+void global_scope_t::visit_man_page() const
+{
+ int pid = fork();
+ if (pid < 0) {
+ throw std::logic_error("Failed to fork child process");
+ }
+ else if (pid == 0) { // child
+ execlp("man", "man", "1", "ledger", (char *)0);
+
+ // We should never, ever reach here
+ perror("execlp: man");
+ exit(1);
+ }
+
+ int status = -1;
+ wait(&status);
+ exit(0); // parent
+}
+
void handle_debug_options(int argc, char * argv[])
{
for (int i = 1; i < argc; i++) {