Skip to content

aadishjain2911/CHASS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CHASS

Code Hide And Seek Surveillance

A user friendly CLI debugging tool exclusively for bash scripts.

Table of Content


If you don't have virtualenv installed

sudo pip3 install virtualenv

Now make a virtual env inside the repo

python3 -m venv chassenv

Activate the virtual env

source chassenv/bin/activate

Now install the chass package

python3 -m pip install .

For all options available

chass --help

File path is the argument that must be provided.

Get the value of changed variables lines by line (functions are to be dealt with separately using function mode given below)

chass {path-to-file}

Get the value of specific multiple variables line by line

 chass {path-to-file} --variable={variable-name_1} --variable={variable-name_3_(optional)}

or

chass {path-to-file} -v {variable-name_1} -v {variable-name_2_(optional)}

Get the value of a specific variable at a specific line

chass {path-to-file} --variable={variable-name} --line={line-number}

or

chass {path-to-file} -v {variable-name} -l {line-number}

Get code at a specified line

chass {path-to-file} --code {line-number}

or

chass {path-to-file} -c {line-number}

Get a particular section of code present between two line numbers

chass {path-to-file} --codeline {start-line-number} {end-line-number}

Debugs only the section present between two line numbers

chass {path-to-file} --breakpoints {start-line-number} {end-line-number}

Debug a function by providing the name of the function

chass {path-to-file} -f {function_name}

or

chass {path-to-file} --function {function_name}

Prints all the changed variables' values at every line in one go

chass {path-to-file} --printall

or

chass {path-to-file} -p

Prints values of the given multiple variables at each line in one go

chass {path-to-file} --printall --variable={variable_name_1} --variable={variable_name_2(optional)}

or

chass {path-to-file} -p -v {variable_name_1} -v {variable_name_2(optional)}

Debug only loops iteration wise

chass {path-to-file} --loops

or

chass {path-to-file} -r

Debug only conditions line by line

chass {path-to-file} --cond

or

chass {path-to-file} -i

Debug only sed commands. You can specify line_number also to debug a specific sed command

chass {path-to-file} --sed -l {line_number}(optional)

or

chass {path-to-file} -s -l {line_number}(optional)

Shows the actual output of the file

chass {path-to-file} --output

or

chass {path-to-file} -o

At any given line you can write valid syntax bash expression involving any of defined variables. We will give value of that expression by using values of variables upto that line

Step 1 : write expr in the default mode() at any line (Note: line should not be in any loop,if and case)

expr

Step 2 : write the expression in bash syntax

{expression_to_be_calculated_in_valid_bash_syntax}

At any line inside default mode() you can print working directory (Note: line should not be in any loop,if and case)

pwd

At any line inside default mode you can get the line written by you in the original code by just typing "c"

c

You can exit the process at any stage by typing quit. If you are inside any loop, a single quit will get you out of the loop and typing quit again will terminate chass

 quit

  1. Absolute File paths should be given everywhere inside the code
  2. Avoid using recursive functions for best usage
  3. Any String should not contain " sed ", " cd " and other keywords as a part of it
  4. Syntax of the file is assumed to be correct
  5. rm command should not be present inside file

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

About

Code hide and seek surveillance

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •  

Languages