| 1 | // This file is part of dummy-monitor. |
| 2 | // |
| 3 | // SPDX-FileCopyrightText: Arduino s.r.l. and/or its affiliated companies |
| 4 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 5 | |
| 6 | package argsscip-go gomod github.com/arduino/pluggable-monitor-protocol-handler . `github.com/arduino/pluggable-monitor-protocol-handler/dummy-monitor/args`/ |
| 7 | |
| 8 | import ( |
| 9 | "fmtscip-go gomod github.com/golang/go/src go1.16 fmt/" |
| 10 | "osscip-go gomod github.com/golang/go/src go1.16 os/" |
| 11 | ) |
| 12 | |
| 13 | // Tag is the current git tag |
| 14 | var Tagscip-go gomod github.com/arduino/pluggable-monitor-protocol-handler . `github.com/arduino/pluggable-monitor-protocol-handler/dummy-monitor/args`/Tag. = "snapshot" |
| 15 | |
| 16 | // Timestamp is the current timestamp |
| 17 | var Timestampscip-go gomod github.com/arduino/pluggable-monitor-protocol-handler . `github.com/arduino/pluggable-monitor-protocol-handler/dummy-monitor/args`/Timestamp. = "unknown" |
| 18 | |
| 19 | // Parse arguments passed by the user |
| 20 | func Parsescip-go gomod github.com/arduino/pluggable-monitor-protocol-handler . `github.com/arduino/pluggable-monitor-protocol-handler/dummy-monitor/args`/Parse().() { |
| 21 | for _, arg := range osscip-go gomod github.com/golang/go/src go1.16 os/.Argsscip-go gomod github.com/golang/go/src go1.16 os/Args.[1:] { |
| 22 | if arg == "" { |
| 23 | continue |
| 24 | } |
| 25 | if arg == "-v" || arg == "--version" { |
| 26 | fmtscip-go gomod github.com/golang/go/src go1.16 fmt/.Printfscip-go gomod github.com/golang/go/src go1.16 fmt/Printf().("dummy-monitor %s (build timestamp: %s)\n", Tagscip-go gomod github.com/arduino/pluggable-monitor-protocol-handler . `github.com/arduino/pluggable-monitor-protocol-handler/dummy-monitor/args`/Tag., Timestampscip-go gomod github.com/arduino/pluggable-monitor-protocol-handler . `github.com/arduino/pluggable-monitor-protocol-handler/dummy-monitor/args`/Timestamp.) |
| 27 | osscip-go gomod github.com/golang/go/src go1.16 os/.Exitscip-go gomod github.com/golang/go/src go1.16 os/Exit().(0) |
| 28 | } |
| 29 | fmtscip-go gomod github.com/golang/go/src go1.16 fmt/.Fprintfscip-go gomod github.com/golang/go/src go1.16 fmt/Fprintf().(osscip-go gomod github.com/golang/go/src go1.16 os/.Stderrscip-go gomod github.com/golang/go/src go1.16 os/Stderr., "invalid argument: %s\n", arg) |
| 30 | osscip-go gomod github.com/golang/go/src go1.16 os/.Exitscip-go gomod github.com/golang/go/src go1.16 os/Exit().(1) |
| 31 | } |
| 32 | } |