Add sync-version
This commit is contained in:
@ -15,6 +15,8 @@ import (
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
const Version = "1.0.0"
|
||||
|
||||
// Config structures
|
||||
type Config struct {
|
||||
Types map[string]DeviceType `yaml:"types"`
|
||||
@ -228,6 +230,8 @@ func main() {
|
||||
Short: "SSH Router Backup Tool",
|
||||
Long: "Connects to routers via SSH and runs commands, saving output to local files.",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
fmt.Printf("IPng Networks Router Backup v%s\n", Version)
|
||||
|
||||
// Load configuration
|
||||
config, err := loadConfig(configPath)
|
||||
if err != nil {
|
||||
|
17
src/version_test.go
Normal file
17
src/version_test.go
Normal file
@ -0,0 +1,17 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestVersion(t *testing.T) {
|
||||
if Version == "" {
|
||||
t.Error("Version constant should not be empty")
|
||||
}
|
||||
|
||||
// Test that version follows semantic versioning pattern
|
||||
// This is a basic check - could be more sophisticated
|
||||
if len(Version) < 5 { // minimum "1.0.0" format
|
||||
t.Errorf("Version '%s' seems too short for semantic versioning", Version)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user