@@ -55,11 +55,12 @@ func listCommands(cfg internal.Config) {
5555 }
5656}
5757
58- func AddBackupCommands (rootCmd * cobra.Command , configPath string ) {
58+ func AddBackupCommands (rootCmd * cobra.Command ) {
5959 var runCmd = & cobra.Command {
6060 Use : "run" ,
6161 Short : "Execute the sync jobs" ,
6262 Run : func (cmd * cobra.Command , args []string ) {
63+ configPath , _ := cmd .Flags ().GetString ("config" )
6364 cfg := internal .LoadResolvedConfig (configPath )
6465 executeSyncJobs (cfg , false )
6566 },
@@ -69,6 +70,7 @@ func AddBackupCommands(rootCmd *cobra.Command, configPath string) {
6970 Use : "simulate" ,
7071 Short : "Simulate the sync jobs" ,
7172 Run : func (cmd * cobra.Command , args []string ) {
73+ configPath , _ := cmd .Flags ().GetString ("config" )
7274 cfg := internal .LoadResolvedConfig (configPath )
7375 executeSyncJobs (cfg , true )
7476 },
@@ -78,6 +80,7 @@ func AddBackupCommands(rootCmd *cobra.Command, configPath string) {
7880 Use : "list" ,
7981 Short : "List the commands that will be executed" ,
8082 Run : func (cmd * cobra.Command , args []string ) {
83+ configPath , _ := cmd .Flags ().GetString ("config" )
8184 cfg := internal .LoadResolvedConfig (configPath )
8285 listCommands (cfg )
8386 },
0 commit comments