[sanexx-commit] SF.net SVN: sanexx: [14]
Status: Pre-Alpha
Brought to you by:
paddy_hack
|
From: <pad...@us...> - 2006-03-12 09:24:10
|
Revision: 14 Author: paddy_hack Date: 2006-03-12 01:24:03 -0800 (Sun, 12 Mar 2006) ViewCVS: http://svn.sourceforge.net/sanexx/?rev=14&view=rev Log Message: ----------- r29@qed: olaf | 2006-03-12 14:48:10 +0900 Unstubbed the disclaimer in display_version(). Improved the output in display_help(). Renamed variable for better code readability. Zapped the short option alternative for --help until we get a better idea of what options will be available. Modified Paths: -------------- trunk/src/scanimage.cc Property Changed: ---------------- / Property changes on: ___________________________________________________________________ Name: svk:merge - 52428bda-890d-0410-88ad-be188b7e1831:/local:28 + 52428bda-890d-0410-88ad-be188b7e1831:/local:29 Modified: trunk/src/scanimage.cc =================================================================== --- trunk/src/scanimage.cc 2006-03-12 09:23:48 UTC (rev 13) +++ trunk/src/scanimage.cc 2006-03-12 09:24:03 UTC (rev 14) @@ -42,27 +42,27 @@ int display_version (const string& program_name); int display_help (const string& program_name, - const po::options_description& desc); + const po::options_description& visible); int list_devices (const string& program_name, - const po::options_description& desc); + const po::options_description& options); int main (int argc, char *argv[]) { string program_name = basename (strdup (argv[0])); - po::options_description common ("Common options"); - common.add_options () + po::options_description visible ("Program Options"); + visible.add_options () ("version", "display version information and exit") - ("help,h", + ("help", "display this help message and exit") ("list-devices", "display a list of available devices") ; po::variables_map vm; - po::store (po::parse_command_line (argc, argv, common), vm); + po::store (po::parse_command_line (argc, argv, visible), vm); po::notify (vm); if (vm.count ("version")) { @@ -70,11 +70,11 @@ } if (vm.count ("help")) { - return display_help (program_name, common); + return display_help (program_name, visible); } if (vm.count ("list-devices")) { - return list_devices (program_name, common); + return list_devices (program_name, visible); } return EXIT_SUCCESS; @@ -84,29 +84,36 @@ int display_version (const string& program_name) { - cout << program_name - << " (" PACKAGE ") " - << PACKAGE_VERSION - << endl + cout << program_name << " (" PACKAGE ") " << PACKAGE_VERSION << endl << "Written by Olaf Meeuwissen." << endl << endl << "Copyright (C) 2006 Olaf Meeuwissen" << endl - << "DISCLAIMER GOES HERE" << endl; + << ("This is free software; see the source for copying conditions.\n" + "There is NO warranty; not even for MERCHANTABILITY or FITNESS\n" + "FOR A PARTICULAR PURPOSE.") + << endl; return EXIT_SUCCESS; } int display_help (const string& program_name, - const po::options_description& desc) + const po::options_description& visible) { - cout << desc << endl; + cout << "Usage: " << program_name << " [OPTION]..." << endl + << "Acquire image data from a raster imaging device." << endl + << "Image data is written to standard output." << endl + << endl + << visible + << endl + << "Report bugs to <" PACKAGE_BUGREPORT << ">." << endl; + return EXIT_SUCCESS; } int list_devices (const string& program_name, - const po::options_description& desc) + const po::options_description& options) { using namespace sane; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |