diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-07-02 18:06:14 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-07-02 18:06:14 +0000 |
commit | dd8500bce782d167a85c31b3e39f550872f44ab1 (patch) | |
tree | cc734f8192ce2350438f66ab9d8e401d3acf8e02 /vi.c | |
parent | 3073dfbf30da26ac60196319866c8e0a931c2789 (diff) | |
download | busybox-w32-dd8500bce782d167a85c31b3e39f550872f44ab1.tar.gz busybox-w32-dd8500bce782d167a85c31b3e39f550872f44ab1.tar.bz2 busybox-w32-dd8500bce782d167a85c31b3e39f550872f44ab1.zip |
Cleanups and sinze reduction for the vi applet from Aaron Lehmann
<aaronl@vitelus.com>
Diffstat (limited to 'vi.c')
-rw-r--r-- | vi.c | 29 |
1 files changed, 15 insertions, 14 deletions
@@ -19,7 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | char *vi_Version = | 21 | char *vi_Version = |
22 | "$Id: vi.c,v 1.10 2001/06/26 02:06:08 bug1 Exp $"; | 22 | "$Id: vi.c,v 1.11 2001/07/02 18:06:14 andersen Exp $"; |
23 | 23 | ||
24 | /* | 24 | /* |
25 | * To compile for standalone use: | 25 | * To compile for standalone use: |
@@ -367,7 +367,7 @@ extern int vi_main(int argc, char **argv) | |||
367 | //case 'h': // help -- just use default | 367 | //case 'h': // help -- just use default |
368 | default: | 368 | default: |
369 | show_help(); | 369 | show_help(); |
370 | break; | 370 | return 1; |
371 | } | 371 | } |
372 | } | 372 | } |
373 | 373 | ||
@@ -2958,34 +2958,35 @@ static Byte *yank_delete(Byte * start, Byte * stop, int dist, int yf) | |||
2958 | 2958 | ||
2959 | static void show_help(void) | 2959 | static void show_help(void) |
2960 | { | 2960 | { |
2961 | printf("These features are available:\n"); | 2961 | puts("These features are available:" |
2962 | #ifdef BB_FEATURE_VI_SEARCH | 2962 | #ifdef BB_FEATURE_VI_SEARCH |
2963 | printf("\tPattern searches with / and ?\n"); | 2963 | "\n\tPattern searches with / and ?" |
2964 | #endif /* BB_FEATURE_VI_SEARCH */ | 2964 | #endif /* BB_FEATURE_VI_SEARCH */ |
2965 | #ifdef BB_FEATURE_VI_DOT_CMD | 2965 | #ifdef BB_FEATURE_VI_DOT_CMD |
2966 | printf("\tLast command repeat with \'.\'\n"); | 2966 | "\n\tLast command repeat with \'.\'" |
2967 | #endif /* BB_FEATURE_VI_DOT_CMD */ | 2967 | #endif /* BB_FEATURE_VI_DOT_CMD */ |
2968 | #ifdef BB_FEATURE_VI_YANKMARK | 2968 | #ifdef BB_FEATURE_VI_YANKMARK |
2969 | printf("\tLine marking with 'x\n"); | 2969 | "\n\tLine marking with 'x" |
2970 | printf("\tNamed buffers with \"x\n"); | 2970 | "\n\tNamed buffers with \"x" |
2971 | #endif /* BB_FEATURE_VI_YANKMARK */ | 2971 | #endif /* BB_FEATURE_VI_YANKMARK */ |
2972 | #ifdef BB_FEATURE_VI_READONLY | 2972 | #ifdef BB_FEATURE_VI_READONLY |
2973 | printf("\tReadonly if vi is called as \"view\"\n"); | 2973 | "\n\tReadonly if vi is called as \"view\"" |
2974 | printf("\tReadonly with -R command line arg\n"); | 2974 | "\n\tReadonly with -R command line arg" |
2975 | #endif /* BB_FEATURE_VI_READONLY */ | 2975 | #endif /* BB_FEATURE_VI_READONLY */ |
2976 | #ifdef BB_FEATURE_VI_SET | 2976 | #ifdef BB_FEATURE_VI_SET |
2977 | printf("\tSome colon mode commands with \':\'\n"); | 2977 | "\n\tSome colon mode commands with \':\'" |
2978 | #endif /* BB_FEATURE_VI_SET */ | 2978 | #endif /* BB_FEATURE_VI_SET */ |
2979 | #ifdef BB_FEATURE_VI_SETOPTS | 2979 | #ifdef BB_FEATURE_VI_SETOPTS |
2980 | printf("\tSettable options with \":set\"\n"); | 2980 | "\n\tSettable options with \":set\"" |
2981 | #endif /* BB_FEATURE_VI_SETOPTS */ | 2981 | #endif /* BB_FEATURE_VI_SETOPTS */ |
2982 | #ifdef BB_FEATURE_VI_USE_SIGNALS | 2982 | #ifdef BB_FEATURE_VI_USE_SIGNALS |
2983 | printf("\tSignal catching- ^C\n"); | 2983 | "\n\tSignal catching- ^C" |
2984 | printf("\tJob suspend and resume with ^Z\n"); | 2984 | "\n\tJob suspend and resume with ^Z" |
2985 | #endif /* BB_FEATURE_VI_USE_SIGNALS */ | 2985 | #endif /* BB_FEATURE_VI_USE_SIGNALS */ |
2986 | #ifdef BB_FEATURE_VI_WIN_RESIZE | 2986 | #ifdef BB_FEATURE_VI_WIN_RESIZE |
2987 | printf("\tAdapt to window re-sizes\n"); | 2987 | "\n\tAdapt to window re-sizes" |
2988 | #endif /* BB_FEATURE_VI_WIN_RESIZE */ | 2988 | #endif /* BB_FEATURE_VI_WIN_RESIZE */ |
2989 | ); | ||
2989 | } | 2990 | } |
2990 | 2991 | ||
2991 | static void print_literal(Byte * buf, Byte * s) // copy s to buf, convert unprintable | 2992 | static void print_literal(Byte * buf, Byte * s) // copy s to buf, convert unprintable |