feat(cli): added --wno-keyring flag to disable keyring
Some checks are pending
Linux / build (push) Waiting to run
MacOS / build (push) Waiting to run
Windows / build (push) Waiting to run

closes #308
This commit is contained in:
veeso
2025-03-22 13:44:02 +01:00
parent 806793421e
commit 368570592f
9 changed files with 91 additions and 73 deletions

View File

@@ -76,6 +76,7 @@ fn parse_args(args: Args) -> Result<RunOpts, String> {
Some(ArgsSubcommands::Config(_)) => RunOpts::config(),
None => {
let mut run_opts: RunOpts = RunOpts::default();
// Version
if args.version {
run_opts.task = Task::Version;
@@ -87,6 +88,10 @@ fn parse_args(args: Args) -> Result<RunOpts, String> {
} else if args.quiet {
run_opts.log_level = LogLevel::Off;
}
// set keyring
if args.wno_keyring {
run_opts.keyring = false;
}
// Match ticks
run_opts.ticks = Duration::from_millis(args.ticks);
// Remote argument
@@ -124,7 +129,9 @@ fn run(run_opts: RunOpts) -> MainResult<()> {
match run_opts.task {
Task::ImportTheme(theme) => run_import_theme(&theme),
Task::InstallUpdate => run_install_update(),
Task::Activity(activity) => run_activity(activity, run_opts.ticks, run_opts.remote),
Task::Activity(activity) => {
run_activity(activity, run_opts.ticks, run_opts.remote, run_opts.keyring)
}
Task::Version => print_version(),
}
}
@@ -168,9 +175,10 @@ fn run_activity(
activity: NextActivity,
ticks: Duration,
remote_args: RemoteArgs,
keyring: bool,
) -> MainResult<()> {
// Create activity manager (and context too)
let mut manager: ActivityManager = match ActivityManager::new(ticks) {
let mut manager: ActivityManager = match ActivityManager::new(ticks, keyring) {
Ok(m) => m,
Err(err) => {
eprintln!("Could not start activity manager: {err}");