Add custom help for magic commands to avoid restarting the kernel. The default one implemented in argparse calls exit and makes the kernel restart.
For the same reason, and because it's not really relevant for magic commands, the default version argument was removed (we could still add it if we wish).
Two issues are a bit annoying when allowing to use help arguments:
When the magic command requires at least one argument (case for %%executable and %%file), the implementation in argparse generates an error which shouldn't be displayed in this case. Cf. argparse issue.
With the way %%executable and %%file magic commands are implemented in xeus-cling, having an empty cell after the first given line by the user is not possible. The following error is displayed:
UsageError: %%executable is a cell magic, but the cell body is empty.
After giving it some thought, a local fix wouldn't be a good way to go since it will require to do some copies and add redundant code. So I think having this error asking to fill the cell (could be a line break) is better (or we could completely rethink the current implementation and regex/parsing cells/lines)...
Add custom
help
for magic commands to avoid restarting the kernel. The default one implemented inargparse
callsexit
and makes the kernel restart. For the same reason, and because it's not really relevant for magic commands, the defaultversion
argument was removed (we could still add it if we wish). Two issues are a bit annoying when allowing to usehelp
arguments:magic command
requires at least one argument (case for%%executable
and%%file
), the implementation inargparse
generates an error which shouldn't be displayed in this case. Cf. argparse issue.%%executable
and%%file
magic commands are implemented in xeus-cling, having an empty cell after the first given line by the user is not possible. The following error is displayed:UsageError: %%executable is a cell magic, but the cell body is empty.
After giving it some thought, a local fix wouldn't be a good way to go since it will require to do some copies and add redundant code. So I think having this error asking to fill the cell (could be a line break) is better (or we could completely rethink the current implementation and regex/parsing cells/lines)...