Open 0ion9 opened 6 years ago
for example
argu e edit -- -e
argu a append -- -a
argu a append -- --append
argu e edit -- --edit
--edit
By reading the source of argu, I suspect you are running into a problem with echo. To demonstrate
echo
echo -E '-e'
echo -E '-E'
echo -E '-s'
echo -E '-n'
echo -E '-q'
So echo is eating any options that it itself uses.
The appropriate fix is probably to use printf "%s\n" "$argv[1]" (and so on) instead of echo -E "$argv[1]", since printf has no options
printf "%s\n" "$argv[1]"
echo -E "$argv[1]"
Let me know if you think this bug should also be filed upstream; I'm currently undecided on that.
seems related https://github.com/oh-my-fish/plugin-argu/pull/2
for example
argu e edit -- -e
-> single blank lineargu a append -- -a
-> '-a'argu a append -- --append
-> '--append'argu e edit -- --edit
->--edit
By reading the source of argu, I suspect you are running into a problem with
echo
. To demonstrateecho -E '-e'
-> blank lineecho -E '-E'
-> blank lineecho -E '-s'
-> blank lineecho -E '-n'
-> blank lineecho -E '-q'
-> '-q'So echo is eating any options that it itself uses.
The appropriate fix is probably to use
printf "%s\n" "$argv[1]"
(and so on) instead ofecho -E "$argv[1]"
, since printf has no optionsLet me know if you think this bug should also be filed upstream; I'm currently undecided on that.