Skip to content

Commit

Permalink
Add placeholder for the wrapper (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Mar 29, 2016
1 parent 2232fc9 commit 83402be
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
25 changes: 25 additions & 0 deletions pkg/commands/commands.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package commands

import (
"fmt"
"os"

"github.com/codegangsta/cli"
Expand All @@ -9,8 +10,26 @@ import (
// . "github.com/moul/advanced-ssh-config/pkg/logger"
)

var SSHFlags = []cli.Flag{}

func init() {
config.ASSHBinary = os.Args[0]

// Populate SSHFlags
boolFlags := []string{"1", "2", "4", "6", "A", "a", "C", "f", "G", "g", "K", "k", "M", "N", "n", "q", "s", "T", "t", "V", "v", "X", "x", "Y", "y"}
stringFlags := []string{"b", "c", "D", "E", "e", "F", "I", "i", "L", "l", "m", "O", "o", "p", "Q", "R", "S", "W", "w"}
for _, flag := range boolFlags {
SSHFlags = append(SSHFlags, cli.BoolFlag{
Name: flag,
})
}
for _, flag := range stringFlags {
SSHFlags = append(SSHFlags, cli.StringFlag{
Name: flag,
Value: "",
})
}
fmt.Println(SSHFlags)
}

// Commands is the list of cli commands
Expand Down Expand Up @@ -66,4 +85,10 @@ var Commands = []cli.Command{
Usage: "Display system-wide information",
Action: cmdInfo,
},
{
Name: "wrapper",
Usage: "Initialize assh, then run SSH",
Action: cmdWrapper,
Flags: SSHFlags,
},
}
21 changes: 21 additions & 0 deletions pkg/commands/wrapper.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package commands

import (
"fmt"

"github.com/codegangsta/cli"

. "github.com/moul/advanced-ssh-config/pkg/logger"
)

func cmdWrapper(c *cli.Context) {
/*conf, err := config.Open()
if err != nil {
Logger.Fatalf("Cannot open configuration file: %v", err)
}*/

Logger.Debugf("Wrapper called with %v", c.Args())
fmt.Println(c.Args())

//conf.WriteSshConfigTo(os.Stdout)
}

0 comments on commit 83402be

Please sign in to comment.