deprecate the --update flag

this has caused users to be confused about what program is outputting
errors
This commit is contained in:
Artturin 2023-03-06 20:48:44 +02:00
parent 1dfd35ede2
commit 7aeaea325c
2 changed files with 5 additions and 4 deletions

View File

@ -15,7 +15,7 @@ pub fn update_database() {
pub fn check_database_exists() {
let database_file = get_database_file();
if !database_file.exists() {
println!("Warning: Nix-index database does not exist, try updating with `comma --update`.");
println!("Warning: Nix-index database does not exist, try updating with `nix run 'nixpkgs#nix-index' --extra-experimental-features 'nix-command flakes'`.");
}
}
@ -24,7 +24,7 @@ pub fn check_database_updated() {
let database_file = get_database_file();
if is_database_old(database_file) {
println!(
"Warning: Nix-index database is older than 30 days, try updating with `comma --update`."
"Warning: Nix-index database is older than 30 days, try updating with `nix run 'nixpkgs#nix-index' --extra-experimental-features 'nix-command flakes'`."
);
}
}

View File

@ -59,12 +59,13 @@ fn main() -> ExitCode {
let args = Opt::parse();
if args.update {
eprintln!("\"comma --update\" has been deprecated. use \"nix run 'nixpkgs#nix-index' --extra-experimental-features 'nix-command flakes'\"");
index::update_database();
}
// The command may not be given if `--update` was specified.
if args.cmd.is_empty() {
return ExitCode::SUCCESS;
return ExitCode::FAILURE;
}
let command = &args.cmd[0];
@ -145,7 +146,7 @@ struct Opt {
#[clap(long, env = "COMMA_PICKER", default_value = "fzy")]
picker: String,
/// Update nix-index database
/// DEPRECATED Update nix-index database
#[clap(short, long)]
update: bool,