diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-06-18 20:44:26 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-06-18 20:44:26 (GMT) |
commit | 5c2de222219de09ea0baf4f078915ee2f747bf4f (patch) | |
tree | fc10b780531fe15f0fb59c3bd1fb2507708aa7e6 | |
parent | 7d0e9c3d963ffcb3f7d6d313dfa55466beb742b9 (diff) | |
download | swift-contrib-5c2de222219de09ea0baf4f078915ee2f747bf4f.zip swift-contrib-5c2de222219de09ea0baf4f078915ee2f747bf4f.tar.bz2 |
Tweak help documentation and add manpages.
-rw-r--r-- | Swift/Packaging/Debian/debian/libswiften.manpages | 1 | ||||
-rw-r--r-- | Swift/Packaging/Debian/debian/manpages/swift.1 | 33 | ||||
-rw-r--r-- | Swift/Packaging/Debian/debian/manpages/swiften-config.1 | 21 | ||||
-rwxr-xr-x | Swift/Packaging/Debian/debian/rules | 1 | ||||
-rw-r--r-- | Swift/Packaging/Debian/debian/swift-im.manpages | 1 | ||||
-rwxr-xr-x | Swift/Packaging/Debian/package.sh | 1 | ||||
-rw-r--r-- | Swift/QtUI/QtSwift.cpp | 13 | ||||
-rw-r--r-- | Swift/QtUI/main.cpp | 11 | ||||
-rw-r--r-- | Swiften/Config/swiften-config.cpp | 10 | ||||
-rw-r--r-- | Swiften/SConscript | 1 |
10 files changed, 86 insertions, 7 deletions
diff --git a/Swift/Packaging/Debian/debian/libswiften.manpages b/Swift/Packaging/Debian/debian/libswiften.manpages new file mode 100644 index 0000000..8795c12 --- /dev/null +++ b/Swift/Packaging/Debian/debian/libswiften.manpages @@ -0,0 +1 @@ +manpages/swiften-config.1 diff --git a/Swift/Packaging/Debian/debian/manpages/swift.1 b/Swift/Packaging/Debian/debian/manpages/swift.1 new file mode 100644 index 0000000..6626b40 --- /dev/null +++ b/Swift/Packaging/Debian/debian/manpages/swift.1 @@ -0,0 +1,33 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.38.4. +.TH SWIFT "1" "June 2011" "Swift" "Swift Manual" +.SH NAME +Swift \- swift +.SH SYNOPSIS +.B swift +[\fIOPTIONS\fR]... +.SH DESCRIPTION +Swift is an instant messaging client for the XMPP network. +.SH OPTIONS +.TP +\fB\-\-debug\fR +Turn on debug logging +.TP +\fB\-\-help\fR +Show this help message +.TP +\fB\-\-version\fR +Show version information +.TP +\fB\-\-netbook\-mode\fR +Use netbook mode display (unsupported) +.TP +\fB\-\-no\-tabs\fR +Don't manage chat windows in tabs (unsupported) +.TP +\fB\-\-latency\-debug\fR +Use latency debugging (unsupported) +.HP +\fB\-\-multi\-account\fR arg (=1) Number of accounts to open windows for (unsupported) +.TP +\fB\-\-start\-minimized\fR +Don't show the login/roster window at startup diff --git a/Swift/Packaging/Debian/debian/manpages/swiften-config.1 b/Swift/Packaging/Debian/debian/manpages/swiften-config.1 new file mode 100644 index 0000000..3717df6 --- /dev/null +++ b/Swift/Packaging/Debian/debian/manpages/swiften-config.1 @@ -0,0 +1,21 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.38.4. +.TH SWIFTEN-CONFIG "1" "June 2011" "swiften-config" "Swift Manual" +.SH NAME +swiften-config \- swiften-config +.SH SYNOPSIS +.B swiften-config +[\fIOPTIONS\fR]... +.SH DESCRIPTION +swiften\-config outputs the Swiften build options. +.TP +\fB\-\-help\fR +Show this help message +.TP +\fB\-\-version\fR +Show version information +.TP +\fB\-\-libs\fR +List the library flags +.TP +\fB\-\-cflags\fR +List the compiler & preprocessor flags diff --git a/Swift/Packaging/Debian/debian/rules b/Swift/Packaging/Debian/debian/rules index 4105fec..ddafbdb 100755 --- a/Swift/Packaging/Debian/debian/rules +++ b/Swift/Packaging/Debian/debian/rules @@ -25,18 +25,19 @@ install: build binary-indep: install binary-arch: install dh_testdir dh_testroot dh_install --sourcedir=debian/tmp dh_installchangelogs dh_installdocs dh_installmenu + dh_installman -a dh_link dh_strip --dbg-package=swift-im-dbg dh_compress dh_fixperms dh_makeshlibs dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums diff --git a/Swift/Packaging/Debian/debian/swift-im.manpages b/Swift/Packaging/Debian/debian/swift-im.manpages new file mode 100644 index 0000000..5e83a38 --- /dev/null +++ b/Swift/Packaging/Debian/debian/swift-im.manpages @@ -0,0 +1 @@ +manpages/swift.1 diff --git a/Swift/Packaging/Debian/package.sh b/Swift/Packaging/Debian/package.sh index c395d25..b98f29d 100755 --- a/Swift/Packaging/Debian/package.sh +++ b/Swift/Packaging/Debian/package.sh @@ -34,17 +34,18 @@ cp -r $DIRNAME/3rdParty/Boost/src/boost/uuid $DIRNAME/3rdParty/Boost/uuid/boost # Create orig tarball for debuild tar czf swift-im_$DEBIAN_VERSION.orig.tar.gz --exclude=$DIRNAME/.git $DIRNAME # Initialize debian files ln -s Swift/Packaging/Debian/debian $DIRNAME/debian ../../../BuildTools/UpdateDebianChangelog.py $DIRNAME/debian/changelog $DEBIAN_VERSION cat $DIRNAME/debian/control.in | sed -e "s/%SWIFTEN_SOVERSION%/$SWIFTEN_SOVERSION/g" > $DIRNAME/debian/control mv $DIRNAME/debian/libswiften.install $DIRNAME/debian/libswiften$SWIFTEN_SOVERSION.install +mv $DIRNAME/debian/libswiften.manpages $DIRNAME/debian/libswiften$SWIFTEN_SOVERSION.manpages mv $DIRNAME/debian/libswiften-dev.install $DIRNAME/debian/libswiften$SWIFTEN_SOVERSION-dev.install # Build cd $DIRNAME set +e debuild -i -I #dpkg-buildpackage -S -rfakeroot -i -I #dpkg-buildpackage -b -rfakeroot -i -I diff --git a/Swift/QtUI/QtSwift.cpp b/Swift/QtUI/QtSwift.cpp index d4c306f..7830150 100644 --- a/Swift/QtUI/QtSwift.cpp +++ b/Swift/QtUI/QtSwift.cpp @@ -53,24 +53,25 @@ namespace Swift{ #define SWIFT_APPCAST_URL "http://swift.im/appcast/swift-mac-dev.xml" #else #define SWIFT_APPCAST_URL "" #endif po::options_description QtSwift::getOptionsDescription() { po::options_description result("Options"); result.add_options() ("debug", "Turn on debug logging") - ("help", "produce help message") - ("netbook-mode", "use netbook mode display (unsupported)") - ("no-tabs", "don't manage chat windows in tabs (unsupported)") - ("latency-debug", "use latency debugging (unsupported)") - ("multi-account", po::value<int>()->default_value(1), "number of accounts to open windows for (unsupported)") - ("start-minimized", "don't show the login/roster window at startup") + ("help", "Show this help message") + ("version", "Show version information") + ("netbook-mode", "Use netbook mode display (unsupported)") + ("no-tabs", "Don't manage chat windows in tabs (unsupported)") + ("latency-debug", "Use latency debugging (unsupported)") + ("multi-account", po::value<int>()->default_value(1), "Number of accounts to open windows for (unsupported)") + ("start-minimized", "Don't show the login/roster window at startup") ; return result; } QtSwift::QtSwift(const po::variables_map& options) : networkFactories_(&clientMainThreadCaller_), autoUpdater_(NULL) { if (options.count("netbook-mode")) { splitter_ = new QSplitter(); } else { diff --git a/Swift/QtUI/main.cpp b/Swift/QtUI/main.cpp index de9d122..0146769 100644 --- a/Swift/QtUI/main.cpp +++ b/Swift/QtUI/main.cpp @@ -10,18 +10,19 @@ #include <boost/version.hpp> #include <iostream> #include <QApplication> #include <QTextCodec> #include <QTranslator> #include <QLocale> #include <Swift/Controllers/Translator.h> #include <Swift/Controllers/ApplicationInfo.h> +#include <Swift/Controllers/BuildVersion.h> #include <SwifTools/Application/PlatformApplicationPathProvider.h> #include "QtSwift.h" #include "QtTranslator.h" int main(int argc, char* argv[]) { QApplication app(argc, argv); QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); @@ -46,20 +47,28 @@ int main(int argc, char* argv[]) { } catch (boost::program_options::unknown_option option) { #if BOOST_VERSION >= 104200 std::cout << "Ignoring unknown option " << option.get_option_name() << " but continuing." << std::endl; #else std::cout << "Error: " << option.what() << " (continuing)" << std::endl; #endif } boost::program_options::notify(vm); if (vm.count("help") > 0) { - std::cout << desc << "\n"; + std::cout << SWIFT_APPLICATION_NAME << " is an instant messaging client for the XMPP network." << std::endl; + std::cout << std::endl; + std::cout << "Usage: " << argv[0] << " [OPTIONS]..." << std::endl; + std::cout << std::endl; + std::cout << desc << std::endl; return 1; } + if (vm.count("version") > 0) { + std::cout << SWIFT_APPLICATION_NAME << " " << buildVersion << std::endl; + return 0; + } Swift::QtSwift swift(vm); int result = app.exec(); Swift::Translator::setInstance(NULL); return result; } diff --git a/Swiften/Config/swiften-config.cpp b/Swiften/Config/swiften-config.cpp index b3875cb..b616711 100644 --- a/Swiften/Config/swiften-config.cpp +++ b/Swiften/Config/swiften-config.cpp @@ -9,18 +9,19 @@ #include <boost/algorithm/string.hpp> #include <boost/program_options/options_description.hpp> #include <boost/program_options/variables_map.hpp> #include <boost/program_options.hpp> #include <boost/version.hpp> #include <string> #include <Swiften/Base/Platform.h> #include <Swiften/Base/Paths.h> +#include <Swiften/Version.h> #include "swiften-config.h" using namespace Swift; void printFlags(const std::vector<std::string>& flags) { for (size_t i = 0; i < flags.size(); ++i) { if (i > 0) { std::cout << " "; @@ -28,18 +29,19 @@ void printFlags(const std::vector<std::string>& flags) { std::cout << flags[i]; } std::cout << std::endl; } int main(int argc, char* argv[]) { boost::program_options::options_description desc; desc.add_options() ("help", "Show this help message") + ("version", "Show version information") ("libs", "List the library flags") ("cflags", "List the compiler & preprocessor flags") ; boost::program_options::variables_map vm; try { boost::program_options::store(boost::program_options::parse_command_line(argc, argv, desc), vm); boost::program_options::notify(vm); } catch (const boost::program_options::unknown_option& option) { @@ -49,21 +51,29 @@ int main(int argc, char* argv[]) { std::cout << "Error: " << option.what() << std::endl; #endif } catch (const boost::program_options::error& e) { std::cout << "Error: " << e.what() << std::endl; return -1; } if (vm.count("help") > 0) { + std::cout << "swiften-config outputs the Swiften build options." << std::endl; + std::cout << std::endl; + std::cout << "Usage: swiften-config [OPTIONS]..." << std::endl; + std::cout << std::endl; std::cout << desc << "\n"; return 0; } + if (vm.count("version") > 0) { + std::cout << "swiften-config " << SWIFTEN_VERSION_STRING << std::endl; + return 0; + } // Read in all variables std::vector<std::string> libs; for (size_t i = 0; LIBFLAGS[i]; ++i) { libs.push_back(LIBFLAGS[i]); } std::vector<std::string> cflags; for (size_t i = 0; CPPFLAGS[i]; ++i) { cflags.push_back(CPPFLAGS[i]); diff --git a/Swiften/SConscript b/Swiften/SConscript index 30fd9b6..12c7456 100644 --- a/Swiften/SConscript +++ b/Swiften/SConscript @@ -356,18 +356,19 @@ if env["SCONS_STAGE"] == "build" : if file == "Swiften.h" or file == "foreach.h" or file == "Log.h" or file == "format.h" : continue swiften_header += "#include <" + include + ">\n" swiften_includes.append(include) swiften_env.WriteVal("Swiften.h", swiften_env.Value(swiften_header)) swiften_includes.append("Swiften/Swiften.h") version_header = "#pragma once\n\n" version_header += "#define SWIFTEN_VERSION 0x%02X%02X%02X\n" % (swiften_env["SWIFTEN_VERSION_MAJOR"], swiften_env["SWIFTEN_VERSION_MINOR"], swiften_env["SWIFTEN_VERSION_PATCH"]) + version_header += "#define SWIFTEN_VERSION_STRING \"%s\"\n" % swiften_env["SWIFTEN_VERSION"] swiften_env.WriteVal("Version.h", swiften_env.Value(version_header)) swiften_includes.append("Swiften/Version.h") # Install swiften if swiften_env.get("SWIFTEN_INSTALLDIR", "") : swiften_env.Install(os.path.join(swiften_env["SWIFTEN_INSTALLDIR"], "lib"), swiften_lib) for alias in myenv["SWIFTEN_LIBRARY_ALIASES"] : myenv.Command(myenv.File(os.path.join(swiften_env["SWIFTEN_INSTALLDIR"], "lib", alias)), [env.Value(swiften_lib[0].name), swiften_lib[0]], symlink) for include in swiften_includes : |