summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xacprep14
-rw-r--r--option.cc3
-rw-r--r--session.cc2
-rw-r--r--session.h20
4 files changed, 36 insertions, 3 deletions
diff --git a/acprep b/acprep
index f1f60b2a..a78ebf0f 100755
--- a/acprep
+++ b/acprep
@@ -19,7 +19,10 @@ if [ -x "$cmd" ]; then
export LIBTOOLIZE="$cmd"
fi
-cat configure.tmpl | sed "s/%VERSION%/$(git describe)/" > configure.in
+COMMIT=$(git describe --all --long | sed 's/heads\///')
+
+cat configure.tmpl | \
+ sed "s/%VERSION%/$COMMIT/" > configure.in
autoreconf --force --install
@@ -142,3 +145,12 @@ fi
"$HERE/configure" --srcdir="$HERE" CXX="$CXX" \
CPPFLAGS="$CPPFLAGS" CXXFLAGS="$CXXFLAGS $local_cxxflags" \
LDFLAGS="$LDFLAGS" LIBS="$LIBS" $SWITCHES "$@"
+
+# Alter the Makefile so that it's not nearly so verbose. This makes finding
+# errors and warnings much easier.
+
+if [ -f Makefile ]; then
+ perl -i -pe 's/^\t(\$\((LIBTOOL|CXX)\).*)/\t\@echo " " CXX \$\@;$1 > \/dev\/null/;' Makefile
+ perl -i -pe 's/^\tmv -f/\t\@mv -f/;' Makefile
+ perl -i -pe 's/^\t(\$\((.*?)LINK\).*)/\t\@echo " " LD \$\@;$1 > \/dev\/null/;' Makefile
+fi
diff --git a/option.cc b/option.cc
index a66bd526..9f40f3d3 100644
--- a/option.cc
+++ b/option.cc
@@ -149,8 +149,7 @@ void process_environment(const char ** envp, const string& tag,
}
void process_arguments(int argc, char ** argv, const bool anywhere,
- expr::scope_t& scope,
- std::list<string>& args)
+ expr::scope_t& scope, std::list<string>& args)
{
for (char ** i = argv; *i; i++) {
if ((*i)[0] != '-') {
diff --git a/session.cc b/session.cc
index 100bb7df..fc97fa9e 100644
--- a/session.cc
+++ b/session.cc
@@ -290,6 +290,8 @@ expr::ptr_op_t session_t::lookup(const string& name)
case 'v':
if (! *(p + 1) || std::strcmp(p, "verbose") == 0)
return MAKE_FUNCTOR(session_t::option_verbose);
+ else if (std::strcmp(p, "version") == 0)
+ return MAKE_FUNCTOR(session_t::option_version);
else if (std::strcmp(p, "verify") == 0)
return MAKE_FUNCTOR(session_t::option_verify);
break;
diff --git a/session.h b/session.h
index 88f6b896..ddd0c484 100644
--- a/session.h
+++ b/session.h
@@ -137,6 +137,26 @@ class session_t : public expr::symbol_scope_t
virtual expr::ptr_op_t lookup(const string& name);
//
+ // Help options
+ //
+
+ value_t option_version(expr::scope_t&) {
+ std::cout << "Ledger " << ledger::version << ", the command-line accounting tool";
+ std::cout << "\n\nCopyright (c) 2003-2008, John Wiegley. All rights reserved.\n\n\
+This program is made available under the terms of the BSD Public License.\n\
+See LICENSE file included with the distribution for details and disclaimer.\n";
+ std::cout << "\n(modules: gmp, pcre";
+#if defined(HAVE_EXPAT) || defined(HAVE_XMLPARSE)
+ std::cout << ", xml";
+#endif
+#ifdef HAVE_LIBOFX
+ std::cout << ", ofx";
+#endif
+ std::cout << ")\n";
+ return NULL_VALUE;
+ }
+
+ //
// Debug options
//