#include "libbb.h"
+/* the CRASHME code is unmaintained, and doesn't currently build */
#define ENABLE_FEATURE_VI_CRASHME 0
initial_cmds[0] = xstrndup(p, MAX_INPUT_LEN);
}
#endif
- while ((c = getopt(argc, argv, "hCR" USE_FEATURE_VI_COLON("c:"))) != -1) {
+ while ((c = getopt(argc, argv, "hCRH" USE_FEATURE_VI_COLON("c:"))) != -1) {
switch (c) {
#if ENABLE_FEATURE_VI_CRASHME
case 'C':
SET_READONLY_MODE(readonly_mode);
break;
#endif
- //case 'r': // recover flag- ignore- we don't use tmp file
- //case 'x': // encryption flag- ignore
- //case 'c': // execute command first
#if ENABLE_FEATURE_VI_COLON
case 'c': // cmd line vi command
if (*optarg)
initial_cmds[initial_cmds[0] != 0] = xstrndup(optarg, MAX_INPUT_LEN);
break;
- //case 'h': // help -- just use default
#endif
- default:
+ case 'H':
show_help();
+ /* fall through */
+
+ default:
+ bb_show_usage();
return 1;
}
}
lmc_len = 0;
adding2q = 0;
#endif
- redraw(FALSE); // dont force every col re-draw
#if ENABLE_FEATURE_VI_COLON
{
}
}
#endif
+ redraw(FALSE); // dont force every col re-draw
//------This is the main Vi cmd handling loop -----------------------
while (editing > 0) {
#if ENABLE_FEATURE_VI_CRASHME
dot--;
}
+/* NB! the CRASHME code is unmaintained, and doesn't currently build */
#if ENABLE_FEATURE_VI_CRASHME
static int totalcmds = 0;
static int Mp = 85; // Movement command Probability
#define vi_full_usage \
"Edit FILE" \
"\n\nOptions:\n" \
- " -R Read-only - do not write to the file"
+ USE_FEATURE_VI_COLON( \
+ " -c Initial command to run ($EXINIT also available)\n") \
+ USE_FEATURE_VI_READONLY( \
+ " -R Read-only - do not write to the file\n") \
+ " -H Short help regarding available features"
#define vlock_trivial_usage \
"[OPTIONS]"