On 08/09/2012 04:40 PM, michael....@mgb.ch wrote:
> Hi
> 
> I cannot get negative numbers to work in command line mode:
> 
> # ./parted -v
> parted (GNU parted) 3.1
> [...]
> # ./parted /dev/cciss/c0d2 mkpart primary 1GiB -1s
> /root/parted-3.1/parted/.libs/parted: invalid option -- '1'

Put a '--' between the last real option and the '-1s' - this tells teh
getopt that parted uses that any remaining '-' prefixed strings are not
really options and should not be treated as such (same as doing "grep --
'-1'" for e.g.):

$ sudo parted /dev/loop1 mkpart primary 1GiB -1s
parted: invalid option -- '1'

$ sudo parted /dev/loop1 mkpart primary 1GiB -- -1s
$ echo $?
0

Regards,
Bryn.



Reply via email to