mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-10 23:49:28 +02:00
50 lines
1.8 KiB
Go
50 lines
1.8 KiB
Go
/*
|
|
Copyright © 2023 Philipp Wolfer <phw@uploadedlobster.com>
|
|
|
|
This file is part of Scotty.
|
|
|
|
Scotty is free software: you can redistribute it and/or modify it under the
|
|
terms of the GNU General Public License as published by the Free Software
|
|
Foundation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
Scotty is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License along with
|
|
Scotty. If not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
package cmd
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
// beamCmd represents the beam command
|
|
var beamCmd = &cobra.Command{
|
|
Use: "beam",
|
|
Short: "Transfer data between two services",
|
|
Long: `Transfers data (listens, loves) between two configured services.
|
|
|
|
The services must be configured and be able to handle export and import of
|
|
the data.`,
|
|
// Run: func(cmd *cobra.Command, args []string) { },
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(beamCmd)
|
|
|
|
// Here you will define your flags and configuration settings.
|
|
|
|
// Cobra supports Persistent Flags which will work for this command
|
|
// and all subcommands, e.g.:
|
|
beamCmd.PersistentFlags().StringP("from", "f", "", "Source service configuration (required)")
|
|
beamCmd.MarkPersistentFlagRequired("from")
|
|
beamCmd.PersistentFlags().StringP("to", "t", "", "Target service configuration (required)")
|
|
beamCmd.MarkPersistentFlagRequired("to")
|
|
beamCmd.PersistentFlags().Int64P("timestamp", "s", 0, "Only import data newer then given Unix timestamp")
|
|
|
|
// Cobra supports local flags which will only run when this command
|
|
// is called directly, e.g.:
|
|
// beamCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
|
}
|