add --help to osm-history, too
authorEddy Petrișor <[email protected]>
Mon, 23 Feb 2009 19:59:31 +0000 (23 21:59 +0200)
committerEddy Petrișor <[email protected]>
Mon, 23 Feb 2009 19:59:31 +0000 (23 21:59 +0200)
ChangeLog
osm-history.cs

index b0a708f..956ebc5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon Feb 23 21:58:32 2009 +0200 Eddy Petrișor <[email protected]>
+
+       * add --help to osm-history, too
+
 Mon Feb 23 19:06:50 2009 +0200 Eddy Petrișor <[email protected]>
 
        * add --help as a possible option to osm-check
index 57f753c..f774899 100644 (file)
@@ -16,8 +16,15 @@ class OsmHistory {
 
        static void Usage ()
        {
-               Console.WriteLine ("Usage: osm-history node|way|relation id");
-               Environment.Exit (1);
+               Usage_r (1);
+       }
+
+       static void Usage_r (int retval)
+       {
+               Console.WriteLine ("Usage:");
+               Console.WriteLine ("\tosm-history node|way|relation id");
+               Console.WriteLine ("\tosm-history --help");
+               Environment.Exit (retval);
        }
 
        static string[] GetTags (OsmObject obj)
@@ -216,6 +223,9 @@ class OsmHistory {
                int i = 0;
                bool out_data = false;
 
+               if (args.Length > 0 && args [0] == "--help") {
+                       Usage_r(0);
+               }
                if (args.Length > 0 && args [0] == "--out") {
                        out_data = true;
                        i++;