TritonDataCenter / node-smartdc

Legacy Client SDK and CLI for Triton Data Center

Home Page:https://tritondatacenter.com/getting-started

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sdc-* commands have weird parsing confusion

bahamat opened this issue · comments

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.

@bahamat wow, nice job narrowing it.