Skip to content

Using the Command Line

Discursif edited this page Apr 10, 2020 · 4 revisions

The command Line is the best and intended way to interact with the Cythan Core. It allow the user to execute custom scripts, compile data, and import mods for the Cythan machine.

The command help is a good way to start.

The CommandLineGenerator.py script

The command line work with the CommandLineGenerator.py script, whitch is a custom script that allow easy to create command, with more security.

This does not respect PEP, or conventions, because it use commentary into the command's function to generate the help command and the syntax.

A command can only acces already define command, that's why the help command is last.

You can execute multiple commands by using the ; character. It will split the string of command by every ; (if it isn't in the middle of a quotes)

Commands

The list of commands are:

  • next: advance a Cythan machine by X
  • debug: show general information about a machine
  • list: list the programs / machines.
  • break: add a breakpoint for debugging.
  • compiler: allow to compile BCL (Basic Cythan Language) into Cythan binary
  • load: Load a Cythan binary file.
  • logs: Getting logs.
  • quit: Stopping the terminal
  • clear: Clear the screen
  • help: show information about the commands / a command.

Aliases replace the command : it is a redirection of a command. Most used command have alises.

Generals commands

Help

The syntax is help [<COMMAND>|cmd], it have aliases ?

  • This command list all the commands loaded before the help command.
  • help <COMMAND>It will show information about a particular command named , work with the aliases.
  • help cmd will show information about the command line.

Quit

The syntax is quit, it have aliases exit and stop

  • This command exit the terminal and stop evrything.

Clear

The syntax is clear, it have aliases cls

  • This command will print a hundered new line character.

Debuging

Logs

The syntax is logs (read [<COUNT>|last]|setlevel [NAME]), it have aliases log (whitout 's' !)

  • logs read <COUNT> allow you to read the last logs of the system.
  • logs read last allow you to read all logs of the active system, from his starting point.
  • logs setlevel [NAME] allow you to print on the command line some logs. The 'NAME' can be WARNING, ERROR, DEBUG, INFO, TEST. You can type 'ALL' to print all logs, and custom type are allowed. Type logs setlevel to reset to none.

Debug

The syntax is debug <MACHINE_NAME> | aliases=db, it have aliases db

  • debug <MACHINE_NAME> will show information about a machine: the module attched to it, basic active data and breakpoints.

Break

The syntax is break <MACHINE_NAME> <VALUE> <MEMORY_POSITION> [0|1], it have aliases b and breakpoint

  • break <MACHINE_NAME> <VALUE> <MEMORY_POSITION> [0|1] will setup a breakpoint for the machine <MACHINE_NAME> at the position <MEMORY_POSITION> if this memory is equal to . A breakpoint will stop the current execution if the condition is met, allowing you to debug the current state of the machine.
  • If the <MEMORY_POSITION> is positive, you need to say if it is the first integer of the second one ([0|1])
  • If the <MEMORY_POSITION> is negative, it will automatically set it up for the first one (since there are not second one)

list

The syntax is list (machine|program)

  • list machine list all the loaded machine, ready to use
  • list program list all the program in the /program folder

Cythan Manipulation

load

The syntax is load <fileName>, it have aliases l

  • load <fileName> create a cythan machine called like the filename (without the extension). The machine will have the positive data store in the file. The file must be in the /programs folder, and should not have the extension '.cyt'.

compiler

The syntax is compiler (compile <input_path> [output_name]|configure (reset|<element> <character>)), it have alises c

  • compiler compile <input_path> [output_name] will compile a file written in BCL from the <input_path> into Cythan Language. The outputed file will be in /program/<output_name>.cyt . If no output_name is chossen, it will keep thge same name as the input file.
  • compiler configure reset Will reset the compiler settings to default.
  • compiler configure <element> <character> will set the differents character mapping to others syntax element. You can change (immediatly follow by the configured character): basicBackLine; basicSeperator, variableEntry{ variableEnd} fonctionArgEntry( fonctionArgEnd) actualPos~ definition= comment# mark: moduleStart[ moduleEnd]

next

The syntax is next <MACHINE_NAME> [INT], it have aliases n

  • next <MACHINE_NAME> [INT] allow you to execute the machine called <MACHINE_NAME> for INT iteration. If you have INT = none, the machine will execute one. You can't execute forever, in case of infinite loop.
Clone this wiki locally