summaryrefslogtreecommitdiff
path: root/vendor/github.com/tkrajina/gpxgo/gpxinfo.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/tkrajina/gpxgo/gpxinfo.go')
-rw-r--r--vendor/github.com/tkrajina/gpxgo/gpxinfo.go38
1 files changed, 38 insertions, 0 deletions
diff --git a/vendor/github.com/tkrajina/gpxgo/gpxinfo.go b/vendor/github.com/tkrajina/gpxgo/gpxinfo.go
new file mode 100644
index 0000000..1315451
--- /dev/null
+++ b/vendor/github.com/tkrajina/gpxgo/gpxinfo.go
@@ -0,0 +1,38 @@
+// Copyright 2013, 2014 Peter Vasil, Tomo Krajina. All
+// rights reserved. Use of this source code is governed
+// by a BSD-style license that can be found in the
+// LICENSE file.
+
+package main
+
+import (
+ "flag"
+ "fmt"
+ "path/filepath"
+
+ "github.com/tkrajina/gpxgo/gpx"
+)
+
+func main() {
+ flag.Parse()
+
+ args := flag.Args()
+ if len(args) != 1 {
+ fmt.Println("Please provide a GPX file path!")
+ return
+ }
+
+ gpxFileArg := args[0]
+ gpxFile, err := gpx.ParseFile(gpxFileArg)
+
+ if err != nil {
+ fmt.Println("Error opening gpx file: ", err)
+ return
+ }
+
+ gpxPath, _ := filepath.Abs(gpxFileArg)
+
+ fmt.Print("File: ", gpxPath, "\n")
+
+ fmt.Println(gpxFile.GetGpxInfo())
+}