aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crates/yt/src/app.rs2
-rw-r--r--crates/yt/src/commands/mod.rs13
2 files changed, 9 insertions, 6 deletions
diff --git a/crates/yt/src/app.rs b/crates/yt/src/app.rs
index 3ea12a4..40b99c5 100644
--- a/crates/yt/src/app.rs
+++ b/crates/yt/src/app.rs
@@ -13,7 +13,7 @@ use anyhow::{Context, Result};
use log::warn;
use sqlx::{SqlitePool, sqlite::SqliteConnectOptions};
-use crate::{config::Config, storage::migrate::migrate_db};
+use crate::{config::def::Config, storage::migrate::migrate_db};
#[derive(Debug)]
pub(crate) struct App {
diff --git a/crates/yt/src/commands/mod.rs b/crates/yt/src/commands/mod.rs
index 5eb1fad..fd6f1b1 100644
--- a/crates/yt/src/commands/mod.rs
+++ b/crates/yt/src/commands/mod.rs
@@ -23,7 +23,7 @@ use crate::{
subscriptions::SubscriptionCommand, update::UpdateCommand, videos::VideosCommand,
watch::WatchCommand,
},
- config::Config,
+ config::def::Config,
storage::db::subscription::{Subscription, Subscriptions},
};
@@ -44,7 +44,7 @@ mod videos;
mod watch;
#[derive(Subcommand, Debug)]
-#[allow(private_interfaces)] // Only the main `implm` method should be accessible.
+#[expect(private_interfaces, reason = "Only the main `implm` method should be accessible.")]
pub(super) enum Command {
/// Manipulate the download cache
Cache {
@@ -54,7 +54,7 @@ pub(super) enum Command {
/// Show, the configuration options in effect.
Config {
- #[command(flatten)]
+ #[command(subcommand)]
cmd: ConfigCommand,
},
@@ -151,7 +151,10 @@ fn complete_subscription_condition(
return output;
};
- let Ok(config) = Config::from_config_file(None, None, None, None) else {
+ let Ok(config_path) = crate::config::paths::config_path() else {
+ return output;
+ };
+ let Ok(config) = Config::from_config_file(&config_path, vec![]) else {
return output;
};
@@ -170,7 +173,7 @@ fn complete_subscription_condition(
let mut pre_output = vec![];
for (sub_name, sub) in all.0 {
- if sub_name.starts_with(&current_prog) && condition(&sub) {
+ if sub_name.contains(&current_prog) && condition(&sub) {
pre_output.push((sub_name.clone(), CompletionCandidate::new(sub_name)));
}
}