Shows it as undocumented command line?? option? Also, figured it does need 3 dashes. Thought I might have mistyped it, and tried it with command and it failed. So does need 3 ---. Not sure why it is undocumented??
Note that 'isatty' test, which will fail. The 'pretend_input_tty' is an undocumented command line option, which can be switched on via ---pretend-input-tty. So, if you want to use parted from a script, my answer is the following: /sbin/parted -a optimal /dev/loop1 ---pretend-input-tty resizepart 4 Yes 522239s