[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r11404: Various improvements to sold
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r11404: Various improvements to soldumper. |
Date: |
Tue, 25 Aug 2009 18:50:30 -0000 |
User-agent: |
Bazaar (1.16.1) |
------------------------------------------------------------
revno: 11404 [merge]
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Mon 2009-08-10 15:37:39 +0200
message:
Various improvements to soldumper.
modified:
utilities/soldumper.cpp
=== modified file 'utilities/soldumper.cpp'
--- a/utilities/soldumper.cpp 2009-04-26 12:12:42 +0000
+++ b/utilities/soldumper.cpp 2009-08-07 23:24:30 +0000
@@ -63,7 +63,18 @@
#endif
const char *SOLDUMPER_VERSION = "0.5";
-static void usage ();
+
+/// \brief Display the command line arguments
+static void
+usage(ostream &o)
+{
+ o << _("This program dumps the internal data of a .sol file")
+ << endl;
+ o << _("Usage: soldumper [h] filename") << endl;
+ o << _("-h\tHelp") << endl;
+ o << _("-f\tForce local directory access") << endl;
+ o << _("-l\tList all .sol files in default dir") << endl;
+}
int
main(int argc, char *argv[])
@@ -86,7 +97,7 @@
// scan for the two main standard GNU options
for (c = 0; c < argc; c++) {
if (strcmp("--help", argv[c]) == 0) {
- usage();
+ usage(cout);
exit(0);
}
if (strcmp("--version", argv[c]) == 0) {
@@ -100,7 +111,8 @@
while ((c = getopt (argc, argv, "hvfl")) != -1) {
switch (c) {
case 'h':
- usage ();
+ usage(cout);
+ exit(0);
break;
case 'v':
@@ -119,7 +131,7 @@
break;
default:
- usage ();
+ usage(cerr);
break;
}
}
@@ -128,8 +140,8 @@
// If no command line arguments have been supplied, do nothing but
// print the usage message.
if (argc < 2) {
- usage();
- exit(0);
+ usage(cerr);
+ exit(1);
}
// get the file name from the command line
@@ -193,19 +205,6 @@
sol.dump();
}
-/// \brief Display the command line arguments
-static void
-usage ()
-{
- cerr << _("This program dumps the internal data of a .sol file")
- << endl;
- cerr << _("Usage: soldumper [h] filename") << endl;
- cerr << _("-h\tHelp") << endl;
- cerr << _("-f\tForce local directory access") << endl;
- cerr << _("-l\tList all .sol files in default dir") << endl;
- exit (-1);
-}
-
// Local Variables:
// mode: C++
// indent-tabs-mode: t
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r11404: Various improvements to soldumper.,
Benjamin Wolsey <=