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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
//! System autostart management command.
//!
//! Provides cross-platform functionality for managing whether kasl automatically starts monitoring when the system boots.
//!
//! ## Features
//!
//! - **Cross-Platform Support**: Windows Task Scheduler, Linux systemd, macOS Launch Agents
//! - **Enable/Disable Toggle**: Simple on/off control for autostart functionality
//! - **Status Checking**: Query current autostart configuration
//! - **Privilege Management**: Handles different privilege levels appropriately
//!
//! ## Usage
//!
//! ```bash
//! # Enable autostart on boot
//! kasl autostart enable
//!
//! # Disable autostart
//! kasl autostart disable
//!
//! # Check current status
//! kasl autostart status
//! ```
use crate;
use cratemsg_print;
use Result;
use ;
/// Command-line arguments for autostart management.
///
/// The autostart command uses subcommands to provide different operations
/// for managing the autostart configuration.
/// Available autostart operations.
///
/// Each variant provides a specific autostart management function:
/// - Enable: Set up automatic startup
/// - Disable: Remove automatic startup
/// - Status: Check current autostart state
/// Executes the autostart command based on the specified operation.
///
/// Delegates to the appropriate autostart library function based on the user's choice,
/// handling platform-specific implementations transparently.
///
/// # Arguments
///
/// * `args` - Parsed command arguments containing the operation to perform
///
/// # Returns
///
/// Returns `Ok(())` on successful operation, or an error if the autostart
/// operation fails (e.g., insufficient privileges, unsupported platform).
/// - System configuration conflicts