@@ -143,7 +143,7 @@ func main() {
143143 banner ()
144144
145145 if flags .remote != "" {
146- closeFS , err := setupRemoteConfiguration (flags .remote )
146+ closeFS , remoteParameters , err := setupRemoteConfiguration (flags .remote )
147147 if err != nil {
148148 // need to setup console logging to display the error message
149149 closeLogger := setupLogging (nil )
@@ -152,6 +152,13 @@ func main() {
152152 exitCode = constants .ExitCannotSetupRemoteConfiguration
153153 return
154154 }
155+ if flags .config == constants .DefaultConfigurationFile && remoteParameters .ConfigurationFile != "" {
156+ flags .config = remoteParameters .ConfigurationFile
157+ }
158+ if flags .name == constants .DefaultProfileName && remoteParameters .ProfileName != "" {
159+ flags .name = remoteParameters .ProfileName
160+ }
161+ flags .resticArgs = remoteParameters .CommandLineArguments
155162 shutdown .AddHook (closeFS )
156163 }
157164
@@ -287,29 +294,18 @@ func main() {
287294}
288295
289296func banner () {
290- clog .Debugf ("resticprofile %s compiled with %s" , version , runtime .Version ())
297+ clog .Debugf (
298+ "resticprofile %s compiled with %s %s/%s" ,
299+ version ,
300+ runtime .Version (),
301+ runtime .GOOS ,
302+ runtime .GOARCH ,
303+ )
291304}
292305
293306func loadConfig (flags commandLineFlags , silent bool ) (cfg * config.Config , global * config.Global , err error ) {
294307 fs := afero .NewOsFs ()
295308
296- // if flags.remote != "" {
297- // // fs = afero.NewMemMapFs()
298- // // parameters, err := loadRemoteConfiguration(fs, flags.remote)
299- // os.Chdir()
300- // _, parameters, err := loadRemoteFiles(flags.remote)
301- // if err != nil {
302- // return nil, nil, fmt.Errorf("cannot load remote configuration: %w", err)
303- // }
304- // // we should probably move this to the context (and keep flags intact)
305- // if flags.config == constants.DefaultConfigurationFile {
306- // flags.config = parameters.ConfigurationFile
307- // }
308- // if flags.name == constants.DefaultProfileName {
309- // flags.name = parameters.ProfileName
310- // }
311- // }
312-
313309 var configFile string
314310 if configFile , err = filesearch .FindConfigurationFile (fs , flags .config ); err == nil {
315311 if configFile != flags .config && ! silent {
0 commit comments