-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cli): use ticker format for addpair #1522
Conversation
|
|
||
export const command = 'addpair <base_currency> <quote_currency>'; | ||
export const command = 'addpair <pair>'; | ||
|
||
export const describe = 'add a trading pair'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export const describe = 'add a trading pair'; | |
export const describe = 'add a trading pair such as LTC/BTC'; |
Let's keep it simple. This is not worth catching 10 different ways of specifiying a pair. Only the following should work: But
|
it says
They are in bad_attempts.log file. I think the problem is that param is mandatory and i cant use flags because I don't pass this parameter. |
Gotcha. Since it's in the help it should work, but honestly if it takes longer than 5 minutes to figure it out, I am fine with removing all of these:
and just allow the |
This modifies the `addpair` command to use the trading pair ticker format such as LTC/BTC used in different commands, while keeping the ability to specify currencies separately. Related issue #1521.
50a77bc
to
b8b0f9b
Compare
Digging into this a bit made me realize that the approach we're using across almost every cli command is somewhat misleading in that it always prints the required, positional command arguments as "Options" in the help output. If you were to actually specify the option by passing it in as a flag instead of a positional argument, such as I can clarify those other commands in a separate PR. For now I changed this so it only uses positional arguments and that both $ ./bin/xucli addpair --help
xucli addpair <pair_id|base_currency> [quote_currency]
add a trading pair
Positionals:
pair_id, base_currency the pair ticker id or base currency[string] [required]
quote_currency the currency used to quote a price [string]
Options:
--help Show help [boolean]
--version Show version number [boolean]
--rpcport, -p RPC service port [number]
--rpchost, -h RPC service hostname [string]
--tlscertpath, -c Path to the TLS certificate of xud [string]
--json, -j Display output in json format [boolean] [default: false]
--xudir, -x Data directory for xud [string]
Examples:
xucli addpair LTC/BTC add the LTC/BTC trading pair by ticker id
xucli addpair LTC BTC add the LTC/BTC trading pair by currencies |
This modifies the
addpair
command to use the trading pair ticker format such as LTC/BTC used in different commands, while keeping the ability to specify currencies separately.Related issue #1521.