[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
poke prompt by default
From: |
Jose E. Marchesi |
Subject: |
poke prompt by default |
Date: |
Tue, 21 Nov 2023 17:24:48 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Hello people.
I recently changed poke so the prompt used in the CLI can be customized
by the user: the CLI calls the Poke function pk_prompt to draw the
prompt.
At this point the default definition of that function is simply:
fun pk_prompt = string:
{
return "(poke) ";
}
This is the one I use instead (loaded from my .pokerc):
fun pk_prompt = string:
{
var prompt = "(";
prompt += get_endian == ENDIAN_BIG ? "big:" : "little:";
try
prompt += iohandler (get_ios);
catch if E_no_ios
{
prompt += "poke";
};
return prompt + ") ";
}
That gives me a nice prompt that reflects both the global endianness and
the currently selected IO space, like:
(big:foo.o) _
I wonder:
1. It is easy for the user to write her own pk_prompt function, that may
be as complex as desired. However, the default version of the
function may use the typical "format string" featuring predefined
tags, such as "(%e:%i)" where %e is replaced by the current
endianness and %i with the selected IO space or "poke" if no IO
space. This could ease a bit customizing prompts, but it would
require documentation etc. The question is: would supporting this be
worth the effort and maintenance?
2. Is the default prompt the right default? We are usually very
conservative with defaults (no pretty-printing, plain output mode,
etc) and that may give people the impression that poke is much more
limited that it actually is. Should we have a default like mine?
Thanks for the feedback.
- poke prompt by default,
Jose E. Marchesi <=