Skip to content

Commit

Permalink
Support multiple string arguments of the same type on `assh wrapper s…
Browse files Browse the repository at this point in the history
…sh` (fix #185)
  • Loading branch information
moul committed Dec 30, 2016
1 parent 7a7fb3b commit 3b6483e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@ With the wrapper, `ssh` will *always* be called with an updated `~/.ssh/config`

### master (unreleased)

* Support multiple string arguments of the same type on `assh wrapper ssh` ([#185](https://github.com/moul/advanced-ssh-config/issues/185))
* Remove the `NoControlMasterMkdir` option, and add the `ControlMasterMkdir` option instead ([#173](https://github.com/moul/advanced-ssh-config/issues/173))
* Accepting string or slices for list options ([#119](https://github.com/moul/advanced-ssh-config/issues/119))
* Add new `PubkeyAcceptedKeyTypes` OpenSSH 7+ field ([#175](https://github.com/moul/advanced-ssh-config/issues/175))
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func cmdWrapper(c *cli.Context) error {
}
}
for _, flag := range config.SSHStringFlags {
if val := c.String(flag); val != "" {
for _, val := range c.StringSlice(flag) {
options = append(options, fmt.Sprintf("-%s", flag))
options = append(options, val)
}
Expand Down
7 changes: 3 additions & 4 deletions pkg/config/ssh_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var SSHStringFlags = []string{"b", "c", "D", "E", "e", "F", "I", "i", "L", "l",

func init() {
// Populate SSHFlags
// FIXME: support slice flags (-O a -O b -O c === []string{"a", "b", "c"}
// FIXME: support count flags (-vvv == -v -v -v)
// FIXME: support joined bool flags (-it == -i -t)
for _, flag := range SSHBoolFlags {
Expand All @@ -22,9 +21,9 @@ func init() {
})
}
for _, flag := range SSHStringFlags {
SSHFlags = append(SSHFlags, cli.StringFlag{
Name: flag,
Value: "",
SSHFlags = append(SSHFlags, cli.StringSliceFlag{
Name: flag,
//Value: "",
})
}
}

0 comments on commit 3b6483e

Please sign in to comment.