TritonDataCenter / node-smartdc

Legacy Client SDK and CLI for Triton Data Center
https://tritondatacenter.com/getting-started
MIT License
61 stars 42 forks source link

sdc-* commands have weird parsing confusion #63

Open bahamat opened 9 years ago

bahamat commented 9 years ago

While attempting to list all deleted machines, I saw this:

$ sdc-listmachines --tombsotne
--offset is invalid metadata; try foo=bar

After a few minutes I realized I had misspelled --tombstone as --tombsotne. My initial problem was solved, but that still left the matter of the odd error message.

With a bit of trial and error, I finally figured out what's going on. Running sdc-* --t* where what comes after --t is not one of tag, type or tombstone, the --t gets expanded to --tags, then the rest of the string gets converted to other long forms, in this case the o gets expanded to --offset.

This happens any time where the first character is t and the second character is any of the short options.

dwlf commented 9 years ago

@bahamat wow, nice job narrowing it.