Changes between Version 1 and Version 2 of CommandLineInterface


Ignore:
Timestamp:
Mar 20, 2012, 2:20:44 PM (13 years ago)
Author:
daniel_h
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CommandLineInterface

    v1 v2  
    33This page introduces the Command Line Interface (CLI) of !RefactorErl. 
    44 
    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]. 
     5We 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]. 
    66 
    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. 
     7We 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. 
    88 
    99== Installation == 
    1010 
    11 If you have successfully downloaded and compiled !RefactorErl, you have nothing else to install. 
     11If you have successfully downloaded and compiled !RefactorErl (see [wiki:Install How to install the tool]), you have nothing else to install. 
    1212 
    13 Before the first usage, you should redefine two functions defined in the !RefactorErl CLI: 
     13Before the first usage, you may want to redefine two functions defined in the !RefactorErl EScript: 
    1414 
    15  * referlpath() defines the directory path to the tool (''.'' by default) 
    16  * referlnode() defines 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) 
    1717 
    18 Also, you should make the ''!RefactorErl'' EScript executable. You may use a command like 
     18Also, you can make the ''!RefactorErl'' EScript executable. 
    1919 
    2020{{{ 
     
    3232For example: 
    3333{{{ 
    34 /path/to/refactorerl/bin/RefactorErl mod fun arg1 arg2 "arg3" 
     34RefactorErl mod fun arg1 arg2 "arg3" 
    3535}}} 
    3636 
    3737will invoke ''mod:fun(arg1, arg2, arg3)'' inside !RefactorErl. 
    3838 
    39 Note that Erlang terms written with spaces should be enclosed by double quote marks. 
     39Note that arguments containing spaces should be enclosed by double quote marks. 
     40 
     41==== Syntactic sugars ==== 
     42 
     43If the function you would like to execute has no arguments, you can simply type 
     44{{{ 
     45RefactorErl mod fun 
     46}}} 
     47 
     48If the function you would like to execute is located in the module ''ri'' and takes no arguments, you can simply type 
     49{{{ 
     50RefactorErl fun 
     51}}} 
    4052 
    4153=== Handling the !RefactorErl server === 
     
    4658}}} 
    4759 
    48 to start up. This command starts an instance of the tool at the previously given node. If the server is already running, you get a message of it. 
     60to 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. 
    4961 
    5062Also, you can stop the previously started !RefactorErl instance. If the server was not running, you will be informed.