1 2 3 4 5 6 7 8 9 10 11
12
13 /*!
14 * ======== ICmd ========
15 * Generic xdc-script (xs) command
16 *
17 * Modules that implement this interface can serve as "commands" that
18 * can be executed from the command line (via `xs`) or from within
19 * XDCscript scripts (without having to fork a separate process to run
20 * `xs`).
21 *
22 * @a(Command Line Example)
23 * The following example runs the `xdc.tools.path` tool from the command
24 * line to get an array of names of all packages below the current
25 * working directory (".").
26 * @p(code)
27 * xs xdc.tools.path -n -a -PR .
28 * @p
29 *
30 * @a(XDCscript Example)
31 * The following example runs the `xdc.tools.path` tool from within
32 * a script to get an array of names of all packages below the current
33 * working directory (".").
34 * @p(code)
35 * var Main = xdc.module('xdc.tools.path.Main');
36 * var result = Main.exec(["-n", "-a", "-PR", "."]);
37 * @p
38 */
39 metaonly interface ICmd {
40
41 //! Usage for this command
42 config String usage[] = [];
43
44 //! `xs` shell entry point
45 final function main(args);
46
47 //! `xs` script entry point
48 final function exec(args);
49
50 instance:
51
52 //! Underlying implementation
53 Any run(Cmdr.Instance cmdr, String args[]);
54 }
55 56 57
58