File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -199,10 +199,20 @@ func parseFlags() ui.CLIOptions {
199199
200200 // Accept daemon address as positional argument (e.g., "derotui --testnet host:port")
201201 if opts .DaemonAddress == "" && flag .NArg () > 0 {
202- arg := flag .Arg (0 )
203- // If it looks like a host:port or hostname, use it as daemon address
204- if strings .Contains (arg , ":" ) || strings .Contains (arg , "." ) {
205- opts .DaemonAddress = arg
202+ arg := strings .TrimSpace (flag .Arg (0 ))
203+ if arg != "" {
204+ // Guard against shell/runtime oddities where executable path may be
205+ // passed as first positional argument (observed on some Termux setups).
206+ if strings .HasPrefix (arg , "/" ) {
207+ if _ , err := os .Stat (arg ); err == nil {
208+ return opts
209+ }
210+ }
211+
212+ // Only treat positional argument as daemon endpoint when it validates.
213+ if _ , err := wallet .NormalizeDaemonAddress (arg ); err == nil {
214+ opts .DaemonAddress = arg
215+ }
206216 }
207217 }
208218
You can’t perform that action at this time.
0 commit comments