sandia-minimega / minimega

minimega
GNU General Public License v3.0
148 stars 66 forks source link

Bug: .alias and string completion #1360

Closed mkunz7 closed 5 years ago

mkunz7 commented 5 years ago

Describe your environment

  1. minimega version: latest
  2. Linux distro/version: 18.04
  3. Go compiler version: 1.12
  4. VM types / na

Describe the bug Creating aliases that would string complete crash minimega

To Reproduce

.alias v=vm info
v

or

.alias h=vm info
h

Expected behavior aliases should take precedence over words in the grammar and not crash mini

jcrussell commented 5 years ago

Example output:

minimega[minimega]$ .alias v=vm info
minimega[minimega]$ v
2019/08/07 10:57:22 INFO minicli.go:252: expanding v -> vm info
2019/08/07 10:57:22 INFO minicli.go:252: expanding v -> vm info
2019/08/07 10:57:22 FATAL minicli.go:198: invalid command: `vm infom info`

Aliases currently expand prefixes. Should we change it to only expand exact matches? Not sure why it's double expanding.

djfritz commented 5 years ago

I'm guessing it should probably behave like bash aliases, as that's what folks are generally used to - so no recursive expansion and only when wrapped as a singular token (wrapped in whitespace).

Thoughts? @jcrussell It seems like we're halfway there... dunno.