Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/app/tui/workers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,17 @@ pub fn spawn_refresh_worker(config: Config, previous_rows: Vec<UnitRow>) -> Rece
let (tx, rx) = mpsc::channel();
thread::spawn(move || {
let fetch_all = should_fetch_all(&config);
let include_unit_files = config.load_filter == "all"
&& config.active_filter == "all"
&& config.sub_filter == "all";
let units = match fetch_services(config.scope, fetch_all)
.and_then(|units| {
let unit_files = fetch_unit_files(config.scope)?;
Ok(merge_unit_file_entries(units, unit_files))
if include_unit_files {
let unit_files = fetch_unit_files(config.scope)?;
Ok(merge_unit_file_entries(units, unit_files))
} else {
Ok(units)
}
})
.map(|u| filter_services(u, &config))
{
Expand Down
7 changes: 0 additions & 7 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ Options:
final-watchdog, cleaning)
--sort <value> Sort order for the list view (auto, name, status)
auto (default): status when all filters are 'all', name otherwise
-i, --installed Include unit-file-only services not loaded by systemd
-u, --user Show units in user instead of system scope
-h, --help Show this help text
-v, --version Show version and copyright"
Expand Down Expand Up @@ -731,12 +730,6 @@ mod tests {
}
}

#[test]
fn usage_mentions_installed_flag() {
assert!(usage().contains("--installed"));
assert!(usage().contains("-i, --installed"));
}

#[test]
fn parse_args_rejects_all_mixed_with_equals_filters() {
let err = parse_args(vec!["lsu", "--all", "--sub=running"])
Expand Down