Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NewCmdStart = &cobra.Command{ Use: "start", Aliases: []string{"."}, Example: "tran sync start", Short: "Start sync your tran config.", Run: func(cmd *cobra.Command, args []string) { if username != ":username" { exCmd := "echo '# My tran config - " + username + "\n\n## Clone\n\n```\ntran sync clone\n```\n\n**for more about sync command, run `tran sync -h`**' >> $HOME/.tran/README.md" gosh.Run(exCmd) gosh.RunMulti(constants.Start_ml(), constants.Start_w()) } else { utils.AuthMessage() } }, } NewCmdClone = &cobra.Command{ Use: "clone", Aliases: []string{"cn"}, Short: CloneHelp(), Run: func(cmd *cobra.Command, args []string) { if username != ":username" { gosh.RunMulti(constants.Clone_ml(), constants.Clone_w()) gosh.RunMulti(constants.Clone_check_ml(), constants.Clone_check_w()) } else { utils.AuthMessage() } }, } NewCmdPush = &cobra.Command{ Use: "push", Aliases: []string{"ph"}, Short: "Push the new changes in tran config file.", Run: func(cmd *cobra.Command, args []string) { if username != ":username" { gosh.RunMulti(constants.Push_ml(), constants.Push_w()) } else { utils.AuthMessage() } }, } NewCmdPull = &cobra.Command{ Use: "pull", Aliases: []string{"pl"}, Short: PullHelp(), Run: func(cmd *cobra.Command, args []string) { if username != ":username" { gosh.RunMulti(constants.Pull_ml(), constants.Pull_w()) } else { utils.AuthMessage() } }, } FetchX = &cobra.Command{ Use: "fetchx", Short: "Special command for windows", Run: func(cmd *cobra.Command, args []string) { if username != ":username" { if runtime.GOOS == "windows" { gosh.PowershellCommand(constants.Clone_w()) } else { fmt.Println("This command isn't avaliable for this platform") } } else { utils.AuthMessage() } }, } )
View Source
var NewAuthCmd = Auth(factory.New())
View Source
var NewGHConfigCmd = GHConfig(factory.New())
View Source
var NewGHRepoCmd = Repo(factory.New())
View Source
var NewReceiveCmd = &cobra.Command{ Use: "receive", Short: "Receive files/directories from remote", Long: "Receive files/directories from remote", RunE: func(cmd *cobra.Command, args []string) error { err := tui.ValidateTranxAddress() if err != nil { return err } tui.HandleReceiveCommand(models.TranOptions{ TranxAddress: constants.DEFAULT_ADDRESS, TranxPort: constants.DEFAULT_PORT, }, args[0]) return nil }, }
View Source
var NewSendCmd = &cobra.Command{ Use: "send", Short: "Send files/directories to remote", Long: "Send files/directories to remote", RunE: func(cmd *cobra.Command, args []string) error { tools.RandomSeed() err := tui.ValidateTranxAddress() if err != nil { log.Fatal(err) } tui.HandleSendCommand(models.TranOptions{ TranxAddress: constants.DEFAULT_ADDRESS, TranxPort: constants.DEFAULT_PORT, }, args) return nil }, }
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.