69 parser = argparse.ArgumentParser(
70 description=
"Find the C handler of a rizin command"
74 default=os.path.join(
"librz",
"core",
"cmd_descs"),
76 help=
"Path to the cmd_descs directory containing the *.yaml files",
82 help=
"Run the grep command directly instead of just showing it",
84 parser.add_argument(
"rzcommand", type=str, help=
"Name of the rizin command")
86 args = parser.parse_args()
92 f
"Command {args.rzcommand} does not exist or it is not converted to rzshell yet."
94 grep_cmd = [
"git",
"grep",
"-n", f
'"{args.rzcommand}"',
"librz/core/cmd"]
96 f
"Some old commands may be found like this: {CRED}{format_shell_command(grep_cmd)}{CEND}"
99 print(f
"Rizin Command: {CRED}{args.rzcommand}{CEND}")
100 print(f
"C handler: {CRED}{c_name}{CEND}")
101 grep_cmd = [
"git",
"grep",
"-nWG", f
"^[^[:blank:]].*{c_name}(",
"*.c"]
102 print(f
"Git command to get it: {CRED}{format_shell_command(grep_cmd)}{CEND}")
106 sys.exit(subprocess.run(grep_cmd, check=
False).returncode)