File tree Expand file tree Collapse file tree 3 files changed +73
-1
lines changed Expand file tree Collapse file tree 3 files changed +73
-1
lines changed Original file line number Diff line number Diff line change
1
+ //
2
+ // This file is part of serial-discovery.
3
+ //
4
+ // Copyright 2021 ARDUINO SA (http://www.arduino.cc/)
5
+ //
6
+ // This software is released under the GNU General Public License version 3,
7
+ // which covers the main part of arduino-cli.
8
+ // The terms of this license can be found at:
9
+ // https://www.gnu.org/licenses/gpl-3.0.en.html
10
+ //
11
+ // You can be released from the requirements of the above licenses by purchasing
12
+ // a commercial license. Buying such a license is mandatory if you want to modify or
13
+ // otherwise use the software for commercial activities involving the Arduino
14
+ // software without disclosing the source code of your own applications. To purchase
15
+ // a commercial license, send an email to [email protected] .
16
+ //
17
+
18
+ package main
19
+
20
+ import (
21
+ "fmt"
22
+ "os"
23
+ )
24
+
25
+ var args struct {
26
+ showVersion bool
27
+ }
28
+
29
+ func parseArgs () {
30
+ for _ , arg := range os .Args [1 :] {
31
+ if arg == "" {
32
+ continue
33
+ }
34
+ if arg == "-v" || arg == "--version" {
35
+ args .showVersion = true
36
+ continue
37
+ }
38
+ fmt .Fprintf (os .Stderr , "invalid argument: %s\n " , arg )
39
+ os .Exit (1 )
40
+ }
41
+ }
Original file line number Diff line number Diff line change 1
1
//
2
2
// This file is part of serial-discovery.
3
3
//
4
- // Copyright 2018 ARDUINO SA (http://www.arduino.cc/)
4
+ // Copyright 2021 ARDUINO SA (http://www.arduino.cc/)
5
5
//
6
6
// This software is released under the GNU General Public License version 3,
7
7
// which covers the main part of arduino-cli.
@@ -26,10 +26,17 @@ import (
26
26
"sync"
27
27
28
28
"github.com/arduino/go-properties-orderedmap"
29
+ "github.com/arduino/serial-discovery/version"
29
30
"go.bug.st/serial/enumerator"
30
31
)
31
32
32
33
func main () {
34
+ parseArgs ()
35
+ if args .showVersion {
36
+ fmt .Printf ("serial-discovery %s (build timestamp: %s)\n " , version .Tag , version .Timestamp )
37
+ return
38
+ }
39
+
33
40
syncStarted := false
34
41
var syncCloseChan chan <- bool
35
42
Original file line number Diff line number Diff line change
1
+ //
2
+ // This file is part of serial-discovery.
3
+ //
4
+ // Copyright 2021 ARDUINO SA (http://www.arduino.cc/)
5
+ //
6
+ // This software is released under the GNU General Public License version 3,
7
+ // which covers the main part of arduino-cli.
8
+ // The terms of this license can be found at:
9
+ // https://www.gnu.org/licenses/gpl-3.0.en.html
10
+ //
11
+ // You can be released from the requirements of the above licenses by purchasing
12
+ // a commercial license. Buying such a license is mandatory if you want to modify or
13
+ // otherwise use the software for commercial activities involving the Arduino
14
+ // software without disclosing the source code of your own applications. To purchase
15
+ // a commercial license, send an email to [email protected] .
16
+ //
17
+
18
+ package version
19
+
20
+ // Tag is the current git tag
21
+ var Tag = "snapshot"
22
+
23
+ // Timestamp is the current timestamp
24
+ var Timestamp = "unknown"
You can’t perform that action at this time.
0 commit comments