1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
use std::path::PathBuf;
use busylib::types::time_of_day::TimeOfDay;
use clap::Subcommand;
use crate::cli::Context;
use crate::error::Result;
#[derive(Debug, Subcommand)]
pub enum UpdaterCommand {
/// Upload a firmware package and start the update
Upload {
/// Firmware TAR package
#[arg(value_name = "FILE")]
file: PathBuf,
},
/// Start a check for available firmware
Check,
/// Show the update and check status
Status,
/// Show the changelog of a firmware version
Changelog {
/// Firmware version
#[arg(value_name = "VERSION")]
version: String,
},
/// Install a firmware version from the cloud
Install {
/// Firmware version
#[arg(value_name = "VERSION")]
version: String,
},
/// Abort the running firmware download
AbortDownload,
/// Show the autoupdate settings
Autoupdate,
/// Change the autoupdate settings
SetAutoupdate {
/// Turn autoupdate on
#[arg(long)]
enable: bool,
/// Turn autoupdate off
#[arg(long, conflicts_with = "enable")]
disable: bool,
/// Start of the autoupdate window
#[arg(long, value_name = "HH:MM")]
start: Option<TimeOfDay>,
/// End of the autoupdate window
#[arg(long, value_name = "HH:MM")]
end: Option<TimeOfDay>,
},
}
impl UpdaterCommand {
pub async fn run(self, _context: &Context) -> Result<()> {
todo!()
}
}