Add suggestion to use vim(1) if installed.

This commit is contained in:
Jonas 'Sortie' Termansen 2016-09-24 00:26:07 +02:00
parent a97e1ef16c
commit 1a87b2f580
2 changed files with 6 additions and 3 deletions

View File

@ -1,3 +1,3 @@
set_minimal="cut dash e2fsprogs grep grub mdocml sed xargs" set_minimal="cut dash e2fsprogs grep grub mdocml sed xargs"
set_basic="$set_minimal binutils bison bzip2 diffutils flex gawk gcc git gzip libstdc++ make patch pkg-config tar xz xorriso" set_basic="$set_minimal binutils bison bzip2 diffutils flex gawk gcc git gzip libcurses libstdc++ make patch pkg-config tar vim xz xorriso"
sets="basic minimal" sets="basic minimal"

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013, 2015 Jonas 'Sortie' Termansen. * Copyright (c) 2013, 2015, 2016 Jonas 'Sortie' Termansen.
* *
* Permission to use, copy, modify, and distribute this software for any * Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@ -22,11 +22,14 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h>
void suggest_editor(const char* filename) void suggest_editor(const char* filename)
{ {
fprintf(stderr, "No command '%s' found, did you mean:\n", filename); fprintf(stderr, "No command '%s' found, did you mean:\n", filename);
fprintf(stderr, " Command 'editor' from package 'utils'\n"); fprintf(stderr, " Command 'editor' from package 'editor'\n");
if ( access("/bin/vim", X_OK) == 0 )
fprintf(stderr, " Command 'vim' from package 'vim'\n");
} }
void suggest_pager(const char* filename) void suggest_pager(const char* filename)