Revision: 1488
http://svn.sourceforge.net/complement/?rev=1488&view=rev
Author: complement
Date: 2007-01-30 07:14:56 -0800 (Tue, 30 Jan 2007)
Log Message:
-----------
inquiry boost::program_options
Added Paths:
-----------
trunk/complement/explore/inquiry/boost/program_options/
trunk/complement/explore/inquiry/boost/program_options/Makefile
trunk/complement/explore/inquiry/boost/program_options/Makefile.inc
trunk/complement/explore/inquiry/boost/program_options/po.cc
Property changes on: trunk/complement/explore/inquiry/boost/program_options
___________________________________________________________________
Name: svn:ignore
+ obj
Added: trunk/complement/explore/inquiry/boost/program_options/Makefile
===================================================================
--- trunk/complement/explore/inquiry/boost/program_options/Makefile (rev 0)
+++ trunk/complement/explore/inquiry/boost/program_options/Makefile 2007-01-30 15:14:56 UTC (rev 1488)
@@ -0,0 +1,19 @@
+# -*- Makefile -*- Time-stamp: <03/11/21 08:02:55 ptr>
+
+SRCROOT := ../../..
+COMPILER_NAME := gcc
+
+include Makefile.inc
+include ${SRCROOT}/Makefiles/top.mak
+
+
+INCLUDES += -I$(SRCROOT)/include -I$(BOOST_INCLUDE_DIR)
+
+# temporary, before dums fix strings:
+# DEFS += -D_STLP_DONT_USE_TEMPLATE_EXPRESSION
+
+LDFLAGS += -L${CoMT_LIB_DIR} -Wl,--rpath=${CoMT_LIB_DIR}:${STLPORT_LIB_DIR}
+
+release-shared : LDLIBS = -lboost_program_options
+stldbg-shared : LDLIBS = -lboost_program_optionsstlg
+dbg-shared : LDLIBS = -lboost_program_optionsg
Added: trunk/complement/explore/inquiry/boost/program_options/Makefile.inc
===================================================================
--- trunk/complement/explore/inquiry/boost/program_options/Makefile.inc (rev 0)
+++ trunk/complement/explore/inquiry/boost/program_options/Makefile.inc 2007-01-30 15:14:56 UTC (rev 1488)
@@ -0,0 +1,4 @@
+# -*- makefile -*- Time-stamp: <04/05/06 18:40:56 ptr>
+
+PRGNAME = po
+SRC_CC = po.cc
Added: trunk/complement/explore/inquiry/boost/program_options/po.cc
===================================================================
--- trunk/complement/explore/inquiry/boost/program_options/po.cc (rev 0)
+++ trunk/complement/explore/inquiry/boost/program_options/po.cc 2007-01-30 15:14:56 UTC (rev 1488)
@@ -0,0 +1,55 @@
+// -*- C++ -*- Time-stamp: <07/01/25 20:52:45 ptr>
+
+#include <iostream>
+#include <boost/program_options.hpp>
+
+using namespace std;
+namespace po = boost::program_options;
+
+int main( int argc, const char **argv )
+{
+ int port;
+ bool is_daemon = false;
+ std::string catalog;
+ try {
+ po::options_description op( "Copyright (C) RightMedia, 2006-2007\nThis is intercessor to reportware (http request retranslator, storing answers)\nOptions" );
+ op.add_options()
+ ( "help,h", "print this help message" )
+ ( "port,p", po::value<int>(&port)->default_value(8080), "listen port (default 8080)" )
+ ( "save,s", po::value<string>(&catalog), "store uploaded stream to catalog (default none)" )
+ ( "daemon,d", "become daemon" );
+
+ po::variables_map vm;
+ po::store( po::parse_command_line( argc, const_cast<char **>(argv), op ), vm );
+ po::notify( vm );
+
+ if ( vm.count( "help" ) ) {
+ cerr << op << endl;
+ return 0;
+ }
+
+ // if ( vm.count( "port" ) ) {
+ // port = vm["port"].as<int>();
+ // }
+
+ // if ( vm.count( "save" ) ) {
+ // catalog = vm["save"].as<string>();
+ // }
+
+ if ( vm.count( "daemon" ) ) {
+ is_daemon = true;
+ }
+
+ cout << "Port: " << port << "\n"
+ << "Catalog: " << catalog << "\n"
+ << "Daemon: " << is_daemon << endl;
+ }
+ catch ( int i ) {
+ cerr << "exception i " << i << endl;
+ }
+ catch ( exception& err ) {
+ cerr << "exception " << err.what() << endl;
+ }
+
+ return 0;
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|