Skip to content

Commit

Permalink
fix: add noshow tag to hide schedule options
Browse files Browse the repository at this point in the history
from main section
  • Loading branch information
creativeprojects committed Nov 14, 2023
1 parent e840956 commit ffee984
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions config/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,9 @@ type ScheduleBaseSection struct {
ScheduleLockMode string `mapstructure:"schedule-lock-mode" show:"noshow" default:"default" enum:"default;fail;ignore" description:"Specify how locks are used when running on schedule - see https://creativeprojects.github.io/resticprofile/schedules/configuration/"`
ScheduleLockWait time.Duration `mapstructure:"schedule-lock-wait" show:"noshow" examples:"150s;15m;30m;45m;1h;2h30m" description:"Set the maximum time to wait for acquiring locks when running on schedule"`
ScheduleEnvCapture []string `mapstructure:"schedule-capture-environment" show:"noshow" default:"RESTIC_*" description:"Set names (or glob expressions) of environment variables to capture during schedule creation. The captured environment is applied prior to \"profile.env\" when running the schedule. Whether capturing is supported depends on the type of scheduler being used (supported in \"systemd\" and \"launchd\")"`
ScheduleIgnoreOnBattery bool `mapstructure:"schedule-ignore-on-battery" default:"false" description:"Don't schedule the start of this profile when running on battery"`
ScheduleIgnoreOnBatteryLessThan int `mapstructure:"schedule-ignore-on-battery-less-than" default:"" description:"Don't schedule the start of this profile when running on battery, and the battery charge left is less than the value"`
ScheduleAfterNetworkOnline bool `mapstructure:"schedule-after-network-online" description:"Don't schedule the start of this profile when the network is offline (supported in \"systemd\")."`
ScheduleIgnoreOnBattery bool `mapstructure:"schedule-ignore-on-battery" show:"noshow" default:"false" description:"Don't schedule the start of this profile when running on battery"`
ScheduleIgnoreOnBatteryLessThan int `mapstructure:"schedule-ignore-on-battery-less-than" show:"noshow" default:"" description:"Don't schedule the start of this profile when running on battery, and the battery charge left is less than the value"`
ScheduleAfterNetworkOnline bool `mapstructure:"schedule-after-network-online" show:"noshow" description:"Don't schedule the start of this profile when the network is offline (supported in \"systemd\")."`
}

func (s *ScheduleBaseSection) setRootPath(_ *Profile, _ string) {
Expand Down
2 changes: 2 additions & 0 deletions examples/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ self:
- "*:00,30"
schedule-permission: user
schedule-log: "_schedule-log.txt"
schedule-ignore-on-battery: true
schedule-after-network-online: true

run-after-fail:
- "echo restic returned an error, command line = ${ERROR_COMMANDLINE}"
Expand Down

0 comments on commit ffee984

Please sign in to comment.