registerCliShortcuts function
void
registerCliShortcuts(
- D4rt d4rt
Registers the CLI API methods as global functions for convenience.
This provides shortcuts like cwd(), cd(), ls() at the top level
in addition to cli.cwd(), cli.cd(), etc.
Only register these if you want the shortcut functions available.
Implementation
void registerCliShortcuts(D4rt d4rt) {
// Directory shortcuts using the proper NativeFunctionImpl signature
d4rt.registertopLevelFunction(
'cwd',
(visitor, args, namedArgs, typeArgs) => cliGlobalHolder.controller.cwd(),
cliLibrary,
);
d4rt.registertopLevelFunction(
'home',
(visitor, args, namedArgs, typeArgs) => cliGlobalHolder.controller.home(),
cliLibrary,
);
}