Changes between Version 1 and Version 2 of CommandLineInterface
- Timestamp:
- Mar 20, 2012, 2:20:44 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CommandLineInterface
v1 v2 3 3 This page introduces the Command Line Interface (CLI) of !RefactorErl. 4 4 5 We provide the user with an [ErlangShellInterface Erlang shell interface], which proves to be pretty useful in most of the cases. However, we realised that sometimes one may need to access the tool from outside the Erlang shell. The proposed CLI provides a lightweight interface that can remotely execute Erlang commands in !RefactorErl. More precisely, it invokes Erlang functions that are specified by command line arguments. The method is based on [http:// www.erlang.org/doc/man/escript.html Erlang Escript].5 We provide the user with an [ErlangShellInterface Erlang shell interface], which proves to be pretty useful in most of the cases. However, we realised that sometimes one may need to access the tool from outside the Erlang shell. The proposed CLI provides a lightweight interface that can remotely execute Erlang commands in !RefactorErl. More precisely, it invokes Erlang functions that are specified by command line arguments. The method is based on [http://en.wikipedia.org/wiki/Remote_procedure_call RPC] and [http://www.erlang.org/doc/man/escript.html Erlang Escript]. 6 6 7 We note that the current version of CLI is a prototype, only discovering opportunities and usefulness of this kind of interface. Notice that the CLI is applicable directly by hand as well as indirectly by code editors. Latter makes !RefactorErl callable from editors that do not support Erlang.7 We note that the current version of CLI is a prototype, only discovering opportunities and usefulness of this kind of interface. As the CLI is executable by any os process, !RefactorErl gets invokable from inside any code editor, turning it into a refactoring and comprehension UI. 8 8 9 9 == Installation == 10 10 11 If you have successfully downloaded and compiled !RefactorErl , you have nothing else to install.11 If you have successfully downloaded and compiled !RefactorErl (see [wiki:Install How to install the tool]), you have nothing else to install. 12 12 13 Before the first usage, you should redefine two functions defined in the !RefactorErl CLI:13 Before the first usage, you may want to redefine two functions defined in the !RefactorErl EScript: 14 14 15 * referlpath() de fines the directory path to the tool (''.'' by default)16 * referlnode() de fines the node name of the tool(''refactorerl@localhost'' by default)15 * referlpath() determines the directory path to the tool (''.'' by default) 16 * referlnode() determines the node name the process of the tool will run on (''refactorerl@localhost'' by default) 17 17 18 Also, you should make the ''!RefactorErl'' EScript executable. You may use a command like18 Also, you can make the ''!RefactorErl'' EScript executable. 19 19 20 20 {{{ … … 32 32 For example: 33 33 {{{ 34 /path/to/refactorerl/bin/RefactorErl mod fun arg1 arg2 "arg3"34 RefactorErl mod fun arg1 arg2 "arg3" 35 35 }}} 36 36 37 37 will invoke ''mod:fun(arg1, arg2, arg3)'' inside !RefactorErl. 38 38 39 Note that Erlang terms written with spaces should be enclosed by double quote marks. 39 Note that arguments containing spaces should be enclosed by double quote marks. 40 41 ==== Syntactic sugars ==== 42 43 If the function you would like to execute has no arguments, you can simply type 44 {{{ 45 RefactorErl mod fun 46 }}} 47 48 If the function you would like to execute is located in the module ''ri'' and takes no arguments, you can simply type 49 {{{ 50 RefactorErl fun 51 }}} 40 52 41 53 === Handling the !RefactorErl server === … … 46 58 }}} 47 59 48 to start up. This command starts an instance of the tool at the previously givennode. If the server is already running, you get a message of it.60 to start up. This command starts an instance of the tool at the formerly defined node. If the server is already running, you get a message of it. 49 61 50 62 Also, you can stop the previously started !RefactorErl instance. If the server was not running, you will be informed.