Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Move command line options to start of line



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Saturday 07 October 2006 06:55, Bart Schaefer wrote:
> On Oct 6,  4:07pm, Peter Stephenson wrote:
> }
> } # This moves an option, possibly with arguments, from before the
> } # cursor to immediately after the command word.
>
> Nice, but not precisely what David Korn had in mind.  Given
>
> zsh% ls -s file1 file2 -l
>
> the result of the command should be
>
> zsh% ls -s -l file1 file2
>
> and not
>
> zsh% ls -l -s file1 file2
>
> I don't think this can be done without removing the trailing option and
> its argument(s) from the line before finding the index of the place to
> insert them again.  (Sufficiently deeply nested expansion might still
> accomplish this in a single replacement.)

this apparently requires knowledge of arguments a given command accepts; this 
makes it rather hard to implement in general way.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFJ0cYR6LMutpd94wRAmc8AJ9mwaNtorSYF/GGhXbxi75CFxMG4wCfbl9j
Rmqgim6+Vtwv7I11rrdEIN4=
=UlMk
-----END PGP SIGNATURE-----



Messages sorted by: Reverse Date, Date, Thread, Author