I have made an easy c program to eject external devices from command line. It needs command eject and udisksctl.
Github link:
https://github.com/lakshayrohila/ehdd
(can be compiled to any name, still no changes will be needed.)
when compiling use
gcc path/to/source/code/code.c -DVERSION=\"version\" -o the_name_you_want
(Tip: Since version is a string literal, any string like- foo, haha, lolololol, etc. can be used. If version will not be given, the program will automatically use unknown as the version.)
(NOTE: Please post bugs and ask for features replying to either this post or posting it to the Issues section of the github repo)