Make paste() a little bit smarter

This commit is contained in:
K. Lange 2022-08-10 21:02:07 +09:00
parent de7e32b9e8
commit bdfb0e2221

View File

@ -46,13 +46,9 @@ KRK_Function(exit) {
} }
KRK_Function(paste) { KRK_Function(paste) {
FUNCTION_TAKES_AT_MOST(1); int enabled = !pasteEnabled;
if (argc) { if (!krk_parseArgs("|p",(const char*[]){"enabled"},&enabled)) return NONE_VAL();
CHECK_ARG(0,bool,int,enabled); pasteEnabled = enabled;
pasteEnabled = enabled;
} else {
pasteEnabled = !pasteEnabled;
}
fprintf(stderr, "Pasting is %s.\n", pasteEnabled ? "enabled" : "disabled"); fprintf(stderr, "Pasting is %s.\n", pasteEnabled ? "enabled" : "disabled");
return NONE_VAL(); return NONE_VAL();
} }