It's unreliable, because you don't know where you'll find 'inet ' or what's the specific spacing of the output. Also, that's not the ip, because you've still got the cidr attached.
And no, fstab is not easy either. For example it fails for:
# /tmp has option_blah in order to ...
changing it to:
# /tmp has option_blah,nosuid in order to ...
Confusing the next person to look at the well intended comment.
It's no impossible to implement fairly reliably, it's not going to take days to do, but you're likely make mistakes. And in both cases you're spawning extra processes instead of just getting the information you need.
PS. also slightly annoying is that everyone is so concerned about the text processing part that barely anyone checks what the tool itself can do. (ip -4 -o a s dev eno1 | awk '{print $4}')