This (like the earlier reply) takes it for granted that your complex command strings are limited to a single "command_word" followed by one "multiword_arg" followed by one "filename". At the very least, you are limited to not more than one multiword_arg per input line, with no variability (no optionality) in the presence of single-word args before and/or after the one multiword_arg.# assume that input from readline is stored in $_ my ( $command, @topic ) = split; my $filename = pop @topic; my $topic = join ' ', @topic;
If you think you need to support command lines that won't conform to those restrictions, there are probably a few tricks for defining a suitable command line syntax that will allow the flexibility you need (e.g. using special characters or "option flags" to delimit multiword_args). Or you might consider using and handling quotes around the multiword_args (as any standard unix shell would do).
In reply to Re: readline and multi-word commands
by graff
in thread readline and multi-word commands
by nick
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |