# HG changeset patch # User meillo@marmaro.de # Date 1180375407 -7200 # Node ID 6c327ae23d2cfd1edf7ac8208d600b4a6586b2bc # Parent 8d8b41f7c0bc65f61a396ee581d47569bfd22e3b added --help to shell edition some cleanups diff -r 8d8b41f7c0bc -r 6c327ae23d2c graph Binary file graph has changed diff -r 8d8b41f7c0bc -r 6c327ae23d2c graph.cpp --- a/graph.cpp Mon May 28 18:43:49 2007 +0200 +++ b/graph.cpp Mon May 28 20:03:27 2007 +0200 @@ -144,13 +144,16 @@ int main(int argc, char **argv){ if (argc == 2) { if (strcmp(argv[1], "--version") == 0) { - cout << "Buddylistgrapher 2.0" << endl; - cout << "====================" << endl; - cout << "by Julian Forster (and a little bit by Markus Schnalke)" << endl; - cout << "http://progmaschine.de.vu" << endl; + cout << "Buddylistgrapher (C++)" << endl; + cout << "======================" << endl; + cout << "version 2.0" << endl; + cout << endl; + cout << "by Julian Forster (http://progmaschine.de.vu)" << endl; + cout << "and a little bit by Markus Schnalke (http://prog.marmaro.de)" << endl; } else if (strcmp(argv[1], "--help") == 0) { - cout << "Buddylistgrapher 2.0" << endl; - cout << "====================" << endl; + cout << "Buddylistgrapher" << endl; + cout << "================" << endl; + cout << endl; cout << "usage: " << argv[0] << " " << endl; cout << endl; cout << "The grapher generates output to stdout." << endl; diff -r 8d8b41f7c0bc -r 6c327ae23d2c graph2.sh --- a/graph2.sh Mon May 28 18:43:49 2007 +0200 +++ b/graph2.sh Mon May 28 20:03:27 2007 +0200 @@ -7,9 +7,28 @@ if [ $# -eq 1 ]; then if [ $1 = '--version' ] ; then - echo 'Buddylistgrapher' - echo 'shellscript edition' - echo 'version 0.1' + echo 'Buddylistgrapher (shell)' + echo '========================' + echo 'version 0.2' + echo + echo 'by Julian Forster (http://progmaschine.de.vu)' + echo 'and Markus Schnalke (http://prog.marmaro.de)' + exit 0 + elif [ $1 = '--help' ] ; then + echo 'Buddylistgrapher (shell)' + echo '========================' + echo + echo "usage: $0 " + echo + echo "The grapher generates output to stdout." + echo "This output is the input for the graphviz tools." + echo + echo "You can use it like this:" + echo "$0 input.txt | dot -Tpng > pic.png" + echo + echo "ToDo:" + echo "The program was written for one specific kind of input data," + echo "so there is still some work to do to use it for general input." exit 0 else @@ -19,22 +38,19 @@ # extract all needed lines grep -e "Profil von:" -e "Nachricht schreiben" $1 > $file + # collect all profil names (we only want them as nodes) cat $file | while read line ; do echo -n "`echo $line | grep "Profil von:" | awk '{print " " $3 " "}'`" >> $file2 done echo >> $file2 -#cat $file2 -#exit - # output echo "digraph G {" cat $file | while read line ; do - isProfil=`echo $line | grep "Profil von:"` - if [ -n "$isProfil" ] ; then + if [ -n "`echo $line | grep "Profil von:"`" ] ; then name=$(echo $line | awk '{ print $3 }') else buddy=$(echo $line | awk '{ print $3 }') @@ -46,7 +62,7 @@ echo "}" - #rm $file $file2 + rm $file $file2 exit 0 fi