diff --git a/README.md b/README.md index 54237ac..9e329b1 100644 --- a/README.md +++ b/README.md @@ -36,14 +36,9 @@ manix "" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | fzf --previ ### nix-env ```sh -sudo nix-env \ - --option extra-substituters https://mlvzk.cachix.org/ \ - --option trusted-public-keys 'mlvzk.cachix.org-1:OxRv8xos92A++mh82CsgVo8J6cHGSVCOBFx7a6nhbWo=' \ - -i -f https://github.com/mlvzk/manix/archive/master.tar.gz +nix-env -i -f https://github.com/mlvzk/manix/archive/master.tar.gz ``` -If you're a trusted user or you don't wanna use the cachix cache you can run it without sudo. - ### Nix with flakes enabled ``` sh diff --git a/src/bin/manix.rs b/src/bin/manix.rs index 3c8c4b6..f362e3f 100644 --- a/src/bin/manix.rs +++ b/src/bin/manix.rs @@ -1,5 +1,4 @@ use anyhow::{Context, Result}; -use colored::*; use comments_docsource::CommentsDatabase; use manix::*; use options_docsource::{OptionsDatabase, OptionsDatabaseType}; @@ -197,26 +196,30 @@ fn main() -> Result<()> { } }); - if !key_only_entries.is_empty() { - const SHOW_MAX_LEN: usize = 50; - print!("{}", "Here's what I found in nixpkgs:".bold()); - for entry in key_only_entries.iter().take(SHOW_MAX_LEN) { - print!(" {}", entry.name().white()); - } - if key_only_entries.len() > SHOW_MAX_LEN { - print!(" and {} more.", key_only_entries.len() - SHOW_MAX_LEN); + { + use colored::*; + + if !key_only_entries.is_empty() { + const SHOW_MAX_LEN: usize = 50; + print!("{}", "Here's what I found in nixpkgs:".bold()); + for entry in key_only_entries.iter().take(SHOW_MAX_LEN) { + print!(" {}", entry.name().white()); + } + if key_only_entries.len() > SHOW_MAX_LEN { + print!(" and {} more.", key_only_entries.len() - SHOW_MAX_LEN); + } + println!("\n"); } - println!("\n"); - } - for entry in entries { - const LINE: &str = "────────────────────"; - println!( - "{}\n{}\n{}", - entry.source().white(), - LINE.green(), - entry.pretty_printed() - ); + for entry in entries { + const LINE: &str = "────────────────────"; + println!( + "{}\n{}\n{}", + entry.source().white(), + LINE.green(), + entry.pretty_printed() + ); + } } Ok(())