This repository has been archived by the owner on Sep 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new feature: start building
secman files
command with send
subcmd
- Loading branch information
Showing
4 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package app | ||
|
||
import ( | ||
"log" | ||
|
||
"github.com/spf13/cobra" | ||
"github.com/abdfnx/tran/tools" | ||
"github.com/scmn-dev/tran/models" | ||
"github.com/scmn-dev/tran/constants" | ||
senderUI "github.com/scmn-dev/tran/tui" | ||
) | ||
|
||
func FilesCMD() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "files", | ||
Short: "Securely transfer and send anything between computers.", | ||
Long: "Securely transfer and send anything between computers.", | ||
} | ||
|
||
cmd.AddCommand(FilesSendCMD()) | ||
|
||
return cmd | ||
} | ||
|
||
func FilesSendCMD() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "send", | ||
Short: "Send files/directories to remote.", | ||
Long: "Send files/directories to remote.", | ||
Aliases: []string{"s"}, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
tools.RandomSeed() | ||
|
||
err := senderUI.ValidateTranxAddress() | ||
|
||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
senderUI.HandleSendCommand(models.TranOptions{ | ||
TranxAddress: constants.DEFAULT_ADDRESS, | ||
TranxPort: constants.DEFAULT_PORT, | ||
}, args) | ||
|
||
return nil | ||
}, | ||
} | ||
|
||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters