Skip to content

Commit

Permalink
Enhance dumb terminal output by fitting graph to window size
Browse files Browse the repository at this point in the history
Co-authored-by: pancho horrilo <[email protected]>
  • Loading branch information
suizman and panchoh committed Dec 7, 2018
1 parent 4bee3b1 commit d3cea05
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/make_graph
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

lines=$(tput lines)
columns=$(tput cols)

dir="$1"
metric="$2"

Expand All @@ -30,7 +33,7 @@ all() {
do
func_name=$(cat /tmp/data | grep -o -F $(cat /tmp/function) | uniq)
echo $func_name
cat /tmp/data | grep -F $(cat /tmp/function) | gnuplot -e "set terminal dumb; set title \"$func_name\" ; plot \"-\" using 1:$parse with lines; pause -1"
cat /tmp/data | grep -F $(cat /tmp/function) | gnuplot -e "set terminal dumb size $columns $lines enhanced ansi256; set title \"$func_name\" ; plot \"-\" using 1:$parse with lines; pause -1"
read -p "Press Enter to continue"
done
}
Expand Down

0 comments on commit d3cea05

Please sign in to comment.