Skip to content

Commit 4a868e8

Browse files
committed
Remove ble go code, and no usage anywhere
1 parent d5b7ab0 commit 4a868e8

25 files changed

Lines changed: 94 additions & 2722 deletions

cmd/meshexec/cli_test.go

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,13 @@ func TestRunFlags_ParsingOnly(t *testing.T) {
4343
"--workdir", "/tmp",
4444
"--timeout", "123",
4545
"--safe-mode",
46-
"--format", "json",
47-
"--encrypt",
48-
"--no-sign",
49-
"--sync",
50-
"--at", "03:00",
51-
"--env", "FOO=1",
52-
"--env", "BAR=two",
53-
"--stdin-file", "./input.txt",
5446
"--", "echo", "hello",
5547
)
5648
if runTarget != "os=linux" || !runDryRun || runWorkDir != "/tmp" || runTimeout != 123 {
5749
t.Fatalf("unexpected run flags parsed: target=%q dry=%v wd=%q timeout=%d", runTarget, runDryRun, runWorkDir, runTimeout)
5850
}
59-
if !runSafeMode || !runEncrypt || !runNoSign || runFormat != "json" || !runSync || runAt != "03:00" {
60-
t.Fatalf("unexpected safety/output/schedule flags: safe=%v enc=%v nosign=%v fmt=%q sync=%v at=%q", runSafeMode, runEncrypt, runNoSign, runFormat, runSync, runAt)
61-
}
62-
if len(runEnv) != 2 || runEnv[0] != "FOO=1" || runEnv[1] != "BAR=two" || runStdinFile != "./input.txt" {
63-
t.Fatalf("unexpected env/stdin flags: env=%v stdin=%q", runEnv, runStdinFile)
51+
if !runSafeMode {
52+
t.Fatalf("expected safe-mode true")
6453
}
6554
}
6655

@@ -75,10 +64,6 @@ func TestRun_Niceties_PopulateMessage(t *testing.T) {
7564
"run",
7665
"-t", "robot && zone=alpha",
7766
"--dry-run",
78-
"--env", "FOO=1",
79-
"--env", "BAR=two",
80-
"--stdin-file", "in.txt",
81-
"--at", "03:00",
8267
"--", "echo",
8368
)
8469
if got == nil {
@@ -87,16 +72,7 @@ func TestRun_Niceties_PopulateMessage(t *testing.T) {
8772
if got.TargetExpr == "" {
8873
t.Fatalf("expected TargetExpr populated")
8974
}
90-
if got.Env == nil || got.Env["FOO"] != "1" || got.Env["BAR"] != "two" {
91-
t.Fatalf("unexpected env map: %+v", got.Env)
92-
}
93-
if got.StdinRef != "in.txt" {
94-
t.Fatalf("expected stdin ref set, got %q", got.StdinRef)
95-
}
96-
// ScheduledAt may or may not parse depending on test time; just ensure field exists (0 ok)
97-
if got.ScheduledAt < 0 {
98-
t.Fatalf("scheduled_at should be >= 0, got %d", got.ScheduledAt)
99-
}
75+
// no env/stdin/schedule flags anymore
10076
}
10177

10278
func TestTUIFlags_ViewParsing(t *testing.T) {

cmd/meshexec/run.go

Lines changed: 9 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,11 @@ import (
1919
)
2020

2121
var (
22-
runTarget string
23-
runDryRun bool
24-
runWorkDir string
25-
runTimeout int
26-
runSafeMode bool
27-
runNoSign bool
28-
runEncrypt bool
29-
runFormat string
30-
runSync bool
31-
runAt string
32-
runEnv []string
33-
runStdinFile string
22+
runTarget string
23+
runDryRun bool
24+
runWorkDir string
25+
runTimeout int
26+
runSafeMode bool
3427
)
3528

3629
// runMessageHook allows tests to inspect the constructed CommandMessage.
@@ -73,11 +66,7 @@ var runCmd = &cobra.Command{
7366

7467
// Log invocation
7568
if logger != nil {
76-
logger.Info("run: starting command dispatch", map[string]interface{}{
77-
"target": runTarget, "dry_run": runDryRun, "workdir": runWorkDir, "timeout_ms": runTimeout,
78-
"safe_mode": runSafeMode, "no_sign": runNoSign, "encrypt": runEncrypt, "format": runFormat,
79-
"sync": runSync, "at": runAt, "env_count": len(runEnv), "stdin_file": runStdinFile,
80-
})
69+
logger.Info("run: starting command dispatch", map[string]interface{}{"target": runTarget, "dry_run": runDryRun, "workdir": runWorkDir, "timeout_ms": runTimeout, "safe_mode": runSafeMode})
8170
}
8271

8372
// Build the command and arguments
@@ -107,41 +96,14 @@ var runCmd = &cobra.Command{
10796
}
10897
}
10998

110-
// CLI performs basic target filtering below
99+
// CLI performs basic target filtering below
111100

112101
// Create a message to represent what would be sent
113102
mh := messages.NewMessageHandler()
114103
msg := mh.CreateCommandMessage(command, cmdArgs, []string{runTarget}, cfg.Device.Name, runWorkDir, runTimeout)
115104
// Fill niceties when present (schema supports omitempty)
116105
msg.TargetExpr = runTarget
117-
if len(runEnv) > 0 {
118-
msg.Env = make(map[string]string, len(runEnv))
119-
for _, kv := range runEnv {
120-
if kv == "" {
121-
continue
122-
}
123-
if eq := strings.IndexByte(kv, '='); eq > 0 {
124-
k := kv[:eq]
125-
v := kv[eq+1:]
126-
msg.Env[k] = v
127-
}
128-
}
129-
}
130-
if runAt != "" {
131-
// Defer parsing to backend; leave as string in CLI, but also store planned epoch if parseable
132-
if d, err := time.Parse("15:04", runAt); err == nil {
133-
// Today at HH:MM; backend may reinterpret
134-
now := time.Now()
135-
when := time.Date(now.Year(), now.Month(), now.Day(), d.Hour(), d.Minute(), 0, 0, now.Location())
136-
if when.Before(now) {
137-
when = when.Add(24 * time.Hour)
138-
}
139-
msg.ScheduledAt = when.Unix()
140-
}
141-
}
142-
if runStdinFile != "" {
143-
msg.StdinRef = runStdinFile
144-
}
106+
// note: env/at/stdin-file options removed
145107

146108
if runMessageHook != nil {
147109
runMessageHook(msg)
@@ -160,23 +122,7 @@ var runCmd = &cobra.Command{
160122
}
161123
fmt.Printf(" Timeout: %dms\n", runTimeout)
162124
fmt.Printf(" Safe : %t\n", runSafeMode)
163-
fmt.Printf(" Sign : %s\n", map[bool]string{true: "disabled", false: "enabled"}[runNoSign])
164-
fmt.Printf(" Encrypt: %t\n", runEncrypt)
165-
if runSync {
166-
fmt.Printf(" Sync : %t\n", runSync)
167-
}
168-
if runAt != "" {
169-
fmt.Printf(" At : %s\n", runAt)
170-
}
171-
if len(runEnv) > 0 {
172-
fmt.Printf(" Env : %s\n", strings.Join(runEnv, ", "))
173-
}
174-
if runStdinFile != "" {
175-
fmt.Printf(" Stdin : %s\n", runStdinFile)
176-
}
177-
if runFormat != "" {
178-
fmt.Printf(" Format : %s\n", runFormat)
179-
}
125+
// removed unused flags output
180126
fmt.Printf(" Msg ID : %s\n", msg.ID)
181127
if logger != nil {
182128
logger.Info("run: dry-run complete", map[string]interface{}{"msg_id": msg.ID})
@@ -321,13 +267,6 @@ func init() {
321267
runCmd.Flags().StringVarP(&runWorkDir, "workdir", "w", "", "working directory for command execution")
322268
runCmd.Flags().IntVarP(&runTimeout, "timeout", "T", 30000, "command timeout in milliseconds")
323269
runCmd.Flags().BoolVar(&runSafeMode, "safe-mode", false, "enable safety filters for dangerous commands (stub)")
324-
runCmd.Flags().BoolVar(&runNoSign, "no-sign", false, "do not sign messages (stub)")
325-
runCmd.Flags().BoolVar(&runEncrypt, "encrypt", false, "encrypt command payloads (stub)")
326-
runCmd.Flags().StringVar(&runFormat, "format", "", "output format for results: text|json (stub)")
327-
runCmd.Flags().BoolVar(&runSync, "sync", false, "ensure synchronized execution start across targets (stub)")
328-
runCmd.Flags().StringVar(&runAt, "at", "", "schedule execution at a specific time (e.g., '03:00' or '+5m') (stub)")
329-
runCmd.Flags().StringArrayVar(&runEnv, "env", nil, "environment variables in KEY=VAL form (repeatable) (stub)")
330-
runCmd.Flags().StringVar(&runStdinFile, "stdin-file", "", "file path to send as stdin to the command (stub)")
331270

332271
rootCmd.AddCommand(runCmd)
333272
}

go.mod

Lines changed: 21 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,71 +6,55 @@ toolchain go1.23.11
66

77
require (
88
github.com/BurntSushi/toml v1.5.0
9-
github.com/charmbracelet/bubbles v0.18.0
10-
github.com/charmbracelet/bubbletea v0.25.0
11-
github.com/charmbracelet/lipgloss v0.13.0
9+
github.com/charmbracelet/bubbles v0.21.0
10+
github.com/charmbracelet/bubbletea v1.3.6
11+
github.com/charmbracelet/lipgloss v1.1.0
1212
github.com/fsnotify/fsnotify v1.9.0
13-
github.com/go-ble/ble v0.0.0-20240122180141-8c5522f54333
1413
github.com/google/uuid v1.6.0
1514
github.com/grandcat/zeroconf v1.0.0
1615
github.com/rs/zerolog v1.34.0
1716
github.com/spf13/cobra v1.9.1
1817
github.com/spf13/viper v1.20.1
1918
github.com/stretchr/testify v1.10.0
20-
tinygo.org/x/bluetooth v0.12.0
2119
)
2220

2321
require (
24-
github.com/JuulLabs-OSS/cbgo v0.0.1 // indirect
2522
github.com/atotto/clipboard v0.1.4 // indirect
2623
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
2724
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
25+
github.com/charmbracelet/colorprofile v0.3.2 // indirect
2826
github.com/charmbracelet/harmonica v0.2.0 // indirect
29-
github.com/charmbracelet/x/ansi v0.1.4 // indirect
30-
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect
27+
github.com/charmbracelet/x/ansi v0.10.1 // indirect
28+
github.com/charmbracelet/x/cellbuf v0.0.13 // indirect
29+
github.com/charmbracelet/x/term v0.2.1 // indirect
3130
github.com/davecgh/go-spew v1.1.1 // indirect
32-
github.com/go-ole/go-ole v1.2.6 // indirect
33-
github.com/go-viper/mapstructure/v2 v2.3.0 // indirect
34-
github.com/godbus/dbus/v5 v5.1.0 // indirect
31+
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
32+
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
3533
github.com/inconshreveable/mousetrap v1.1.0 // indirect
3634
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
37-
github.com/mattn/go-colorable v0.1.13 // indirect
35+
github.com/mattn/go-colorable v0.1.14 // indirect
3836
github.com/mattn/go-isatty v0.0.20 // indirect
3937
github.com/mattn/go-localereader v0.0.1 // indirect
40-
github.com/mattn/go-runewidth v0.0.15 // indirect
41-
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
42-
github.com/mgutz/logxi v0.0.0-20161027140823-aebf8a7d67ab // indirect
38+
github.com/mattn/go-runewidth v0.0.16 // indirect
4339
github.com/miekg/dns v1.1.68 // indirect
44-
github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b // indirect
40+
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
4541
github.com/muesli/cancelreader v0.2.2 // indirect
46-
github.com/muesli/reflow v0.3.0 // indirect
47-
github.com/muesli/termenv v0.15.2 // indirect
48-
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
49-
github.com/pkg/errors v0.9.1 // indirect
42+
github.com/muesli/termenv v0.16.0 // indirect
43+
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
5044
github.com/pmezard/go-difflib v1.0.0 // indirect
51-
github.com/raff/goble v0.0.0-20190909174656-72afc67d6a99 // indirect
5245
github.com/rivo/uniseg v0.4.7 // indirect
53-
github.com/sagikazarmark/locafero v0.7.0 // indirect
54-
github.com/sahilm/fuzzy v0.1.1-0.20230530133925-c48e322e2a8f // indirect
55-
github.com/saltosystems/winrt-go v0.0.0-20241223121953-98e32661f6ff // indirect
56-
github.com/sirupsen/logrus v1.9.3 // indirect
57-
github.com/sourcegraph/conc v0.3.0 // indirect
58-
github.com/soypat/cyw43439 v0.0.0-20250505012923-830110c8f4af // indirect
59-
github.com/soypat/seqs v0.0.0-20250124201400-0d65bc7c1710 // indirect
60-
github.com/spf13/afero v1.12.0 // indirect
61-
github.com/spf13/cast v1.7.1 // indirect
62-
github.com/spf13/pflag v1.0.6 // indirect
46+
github.com/sagikazarmark/locafero v0.10.0 // indirect
47+
github.com/sahilm/fuzzy v0.1.1 // indirect
48+
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect
49+
github.com/spf13/afero v1.14.0 // indirect
50+
github.com/spf13/cast v1.9.2 // indirect
51+
github.com/spf13/pflag v1.0.7 // indirect
6352
github.com/subosito/gotenv v1.6.0 // indirect
64-
github.com/tinygo-org/cbgo v0.0.4 // indirect
65-
github.com/tinygo-org/pio v0.2.0 // indirect
66-
go.uber.org/atomic v1.9.0 // indirect
67-
go.uber.org/multierr v1.9.0 // indirect
68-
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect
53+
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
6954
golang.org/x/mod v0.27.0 // indirect
7055
golang.org/x/net v0.43.0 // indirect
7156
golang.org/x/sync v0.16.0 // indirect
7257
golang.org/x/sys v0.35.0 // indirect
73-
golang.org/x/term v0.34.0 // indirect
7458
golang.org/x/text v0.28.0 // indirect
7559
golang.org/x/tools v0.36.0 // indirect
7660
gopkg.in/yaml.v3 v3.0.1 // indirect

0 commit comments

Comments
 (0)