Skip to content

Instantly share code, notes, and snippets.

@Gydo194
Created April 16, 2020 13:37
Show Gist options
  • Save Gydo194/7b0d0f3940da4937dc0943252188381b to your computer and use it in GitHub Desktop.
Save Gydo194/7b0d0f3940da4937dc0943252188381b to your computer and use it in GitHub Desktop.
Java classdiagram helper script
#!/bin/bash
FILE=$1
#public members
printf "\nPUBLIC MEMBERS\n"
fgrep 'public' $FILE | fgrep -v '(' | fgrep -v 'class' | awk '{print $3}'
#private members
printf "\nPRIVATE MEMBERS\n"
fgrep 'private' $FILE | fgrep -v '(' | awk '{print $3}'
printf "\nPUBLIC FUNCTIONS\n"
fgrep 'public' $FILE | egrep -v 'class|get|set|abstract' | awk '{$1=""; print}' | tr -d '{' | sed -e 's/^[ \t]*//'
printf "\nPRIVATE FUNCTIONS\n"
fgrep 'private' $FILE | egrep -v 'class|get|set|abstract' | fgrep '(' | awk '{$1=""; print}' | tr -d '{' | sed -e 's/^[ \t]*//'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment