stosh - shmolyneaux/SquareJam GitHub Wiki
Stosh is a STOrage SHell. It is designed to treat the database in a similar fashion to a file system that would be accessed through a terminal. Using the following simple commands we can many things with the database (Note: all commands are lowercase):
-
cd: change directory, works like in a terminal, though you can only change one directory at a time. Example:
cd Server
, orcd ..
to go to the parent directory. -
ls: lists everything stored in the current directory. Example:
ls
Note: may not work for Objects containing attributes with.
in their name. ie an Object with attributehome.js
may causels
to fail -
su: switch user, can take a name as an argument. Example:
su
orsu root
-
make: creates a specified data-type in the current directory. The first argument is the type, the second is the name: Example:
make Object new_obj
. Types includeList
(note the capitalization),Dict
,Method
,Object
,int
,str
,float
,bool
,None
. This will overwrite an attribute if it already exists -
rm: removes objects (
Lists
,Dicts
,Methods
,Objects
) and primitive data-types. Example:rm bad_obj
orrm new_int
-
edit: allows editing of Methods, and simple data-types. Prompts the user for an editor if none has been set.
vi
,vim
,nano
, andgedit
are examples of editors that can be used. You must fully exit out of the editor (saving first) before changes will be made on the server. There are problems with opening multiple instances of gedit, and likely other graphic text editors where changes will not be saved. Example:edit my_method
Note: If a method fails to compile the changes are lost, it is currently recommended to use StorGUI for this and other reasons. Stosh should only be used if StorGUI isn't added to the Server, if storserv and pstorage are being used outside of SnakeCharmer, or by developer preference.