codeskyblue / codeskyblue/go-sh

Dont support uint in arguments

Open
#19 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.1k
Forks
137
PR merge metrics
No merged PRs in 30d

Description

Hello!
i tried use this:

```
package main

import (
"github.com/codeskyblue/go-sh"
"log"
"fmt"
)

func main() {
port := uint(1)

session := sh.NewSession()
session.ShowCMD = true
out, err := session.Command("/Users/Ivan/Downloads/redis-3.2.3/src/redis-server", "--port", port).Output()
if err != nil {
log.Fatal("ERROR: ", err)
}
fmt.Println("output is", string(out))
}

```

And have result:

```
/usr/local/go/bin/go run /Users/Ivan/Documents/GolangSpace/src/examples/test.go
[golang-sh]$ /Users/Ivan/Downloads/redis-3.2.3/src/redis-server --port

*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 2
>>> 'port'
Bad directive or wrong number of arguments
2016/09/09 15:55:25 ERROR: exit status 1
exit status 1
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how session.Command handles non-string arguments, using the issue's uint port example as the reproduction. Confirm the current command output and add coverage for uint arguments; done means the generated command includes the value after --port and Redis no longer reports a missing argument.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.