This might work for you (GNU sed):
sed 's/--file=\S\+\s\?//' file
This removes the string beginning --file=
and ending in one or non-space characters followed by an optional space.
sed -r 's/((--\S+\s?){3})--\S+\s?/\1/' file
This removes the fourth string beginning with --
followed by one or more non-space characters followed by a possible space. The fourth occurrence is found by grouping the first three such string and then another and replacing the match by the group.
The reverse of the above can be achieved by using:
sed '/\n/!s/--\S\+/\n&\n/g;/^--file=/P;D' file
This splits each line into string beginning with --
and printing the one(s) that begin --file=
.
sed '/\n/!s/--\S\+/\n&\n/g;/^--/{x;s/^/x/;/^x\{3\}$/{x;P;x};x};D' file
This would extract the third option.
sed '/\n/!s/--\S\+/\n&\n/g;/^--/{x;s/^/x/;/^x\{2,3\}$/{x;P;x};x};D' file
This would extract the second and third options.