MCPcopy Create free account
hub / github.com/GNOME/gjs / runcmd

Function runcmd

modules/script/_bootstrap/debugger.js:939–957  ·  view source on GitHub ↗
(cmd)

Source from the content-addressed store, hash-verified

937}
938
939function runcmd(cmd) {
940 var pieces = breakcmd(cmd);
941 if (pieces[0] === '')
942 return undefined;
943
944 var first = pieces[0], rest = pieces[1];
945 if (!Object.hasOwn(commands, first)) {
946 print(`unrecognized command '${first}'`);
947 return undefined;
948 }
949
950 cmd = commands[first];
951 if (cmd.length === 0 && rest !== '') {
952 print('this command cannot take an argument');
953 return undefined;
954 }
955
956 return cmd(rest);
957}
958
959function preReplCleanups() {
960 while (replCleanups.length > 0)

Callers 1

replFunction · 0.85

Calls 1

breakcmdFunction · 0.85

Tested by

no test coverage detected