So far all the help sections were statically generated from the YAML
files, however sometimes you may want to list things in the help
messages that depend on what is loaded in Rizin (e.g. plugins, etc.).
This patch adds support for a details_cb that provides a dynamically
created RzCmdDescDetail array.
* Changed behavior of `f` to only add flag if there is none
* Changed behavior of `f+` to add flag in any case
* Moved listing subcommands from `f` to `fl`
* Moved listing subcommands from `f.` to `f.l`
* Added subcommand `f.l*` to list all local flags in all functions
* Listing flags at the current offset became `fl.`
* Moved `f=` to `fl=`
* Old `fl` (flag length) now became `fL`
* Removed original `fe` commands
* Old `f?` (check if flag exists) now became `fe`
* Removed `fV` commands
* Removed `fn` commands in favor of `fl` and `asm.flags.real=true`
* Removed `fS` commands (`fSo` and `fSn`)
* `fo` became `fortune` and moved from "flags" to "shell" category
* Removed oldshell handlers of the `z` commands
Instead of relying on the developer to remember to use the
RZ_CMD_ARG_FLAG_LAST flag on the last argument when it is of the right
type, we can just set it automatically. We do it only for RZNUM, STRING
and CMD types and this can be bypassed if the devs really want. We do
not add this flag on all types because otherwise all commands handlers
would accept any number of argument. It is good instead to have the
parser immediately detect when too many arguments are passed to some
commands.
In this way things such as:
(10 + 3)
Are interpreted as regular $.args, composed of:
- `(` as (arg_identifier)
- `10` as (arg (arg_identifier))
- `+` as (arg (arg_identifier))
- `3` as (arg (arg_identifier))
- `)` as (arg_identifier)
* Fix `???` command, which should show the help of `?`
Due to recent changes it was not working anymore, because it was
interpreteing `???` as the help with detail=3 of the root node. This
patch limits the number of detail to 2 (which is what is already assumed
in another parts of the code anyway), so that `???` can be interpreted
as the help with detail=2 of `?`. For now this makes it work, however
there needs to be some review of the whole `?` subtree.
* Add test for ???
* Fix ??? test spaces
Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
Co-authored-by: Florian Märkl <info@florianmaerkl.de>
* Create RzCmdDesc generator from YAML file
The commands tree can be entirely described in a YAML file, that is
parsed at build-time and generates cmd_descs.c/cmd_descs.h files. The
developer then just needs to provide the handler with the proper name to
make sure things work.
* Add PyYAML to CI jobs