summaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
authorTim Landscheidt <tim@tim-landscheidt.de>2019-01-12 19:59:21 +0000
committerTim Landscheidt <tim@tim-landscheidt.de>2019-01-12 19:59:42 +0000
commitccb7019c8b014b907d88bbcfb802b7f1458383b6 (patch)
tree2e1ea7f883752d8971a6dcbfed88141fee515632 /src/main.cc
parent40f84faa52396633dfc6756f04d89443bfa4debb (diff)
downloadfork-ledger-ccb7019c8b014b907d88bbcfb802b7f1458383b6.tar.gz
fork-ledger-ccb7019c8b014b907d88bbcfb802b7f1458383b6.tar.bz2
fork-ledger-ccb7019c8b014b907d88bbcfb802b7f1458383b6.zip
Use HAVE_EDIT only in main.cc
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main.cc b/src/main.cc
index c8b9ec3a..4348e8a6 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2018, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2019, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -35,6 +35,10 @@
// was moved there for the sake of clarity here
#include "session.h"
+#ifdef HAVE_EDIT
+#include <editline/readline.h>
+#endif
+
using namespace ledger;
#if HAVE_BOOST_PYTHON
@@ -128,13 +132,9 @@ int main(int argc, char * argv[], char * envp[])
bool exit_loop = false;
-#if HAVE_EDIT
-
+#ifdef HAVE_EDIT
rl_readline_name = const_cast<char *>("Ledger");
-#if 0
- // jww (2009-02-05): NYI
- rl_attempted_completion_function = ledger_completion;
-#endif
+ // TODO: rl_attempted_completion_function = ledger_completion;
while (char * p = readline(global_scope->prompt_string())) {
char * expansion = NULL;
@@ -173,7 +173,7 @@ int main(int argc, char * argv[], char * envp[])
global_scope->execute_command_wrapper(split_arguments(p), true);
}
-#if HAVE_EDIT
+#ifdef HAVE_EDIT
if (expansion)
std::free(expansion);
std::free(p);