Skip to content

Commit

Permalink
re-add transports add
Browse files Browse the repository at this point in the history
  • Loading branch information
ivcosla committed Mar 7, 2019
1 parent d1f9075 commit 2f50a35
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions cmd/skywire-cli/commands/transports.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ func makeTransportsCmds() *cobra.Command {
typesFilter []string
pksFilter pkSlice
logs bool
transportType string
public bool
)

tabPrint := func(trList ...*node.TransportSummary) {
Expand Down Expand Up @@ -84,6 +86,28 @@ func makeTransportsCmds() *cobra.Command {
},
})

add := &cobra.Command{
Use: "add [transport-public-key]",
Short: "adds a new transport",
Args: cobra.MinimumNArgs(1),
Run: func(_ *cobra.Command, args []string) {
pk := cipher.PubKey{}
catch(pk.Set(args[0]))

tr, err := client().AddTransport(pk,
transportType, public)

catch(err)

tabPrint(tr)
},
}
add.Flags().StringVar(&transportType, "type", "messaging",
"type of the transport to add")
add.Flags().BoolVar(&public, "public", true,
"whether to add the transport as public or private")
c.AddCommand(add)

list := &cobra.Command{
Use: "list",
Short: "lists the available transports with optional filter flags",
Expand Down

0 comments on commit 2f50a35

Please sign in to comment.