-
Notifications
You must be signed in to change notification settings - Fork 0
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
move tui to a (default) subcommand #270
base: dev
Are you sure you want to change the base?
Conversation
In testing this, I discovered that
|
I think I want to discuss this as a team. RequirementsAny good solution will satisfy
Option A - split out
|
Option E - no flag collisionsReplace The whole short-code is designed to be a single letter. We're hitting I strongly believe we should NOT change |
Ok! where this has settled1.
|
launchTui(entropy, opts) | ||
|
||
// print entropy help and exit | ||
cli.help() |
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.
is displaying the help text when a user types only entropy
what we expect to happen? Also should we update the package json script for yarn start
to start the TUI instead of just displaying the help text?
async function setupConfig () { | ||
let storedConfig = await config.get() | ||
|
||
// set selectedAccount if we can | ||
if (!storedConfig.selectedAccount && storedConfig.accounts.length) { | ||
storedConfig = await config.setSelectedAccount(storedConfig.accounts[0]) | ||
} | ||
|
||
return storedConfig | ||
} |
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.
just a thought: do we need to implement this for the CLI too? or are we assuming that a user will have an account selected when using the programmatic cli?
Problem
I was hitting some problems with options colliding between the root
entropy
command and the other sub-commands likeentropy account register
.Solution
Reading the
commander
docs I saw there was an option for commands{ default: true }
. This allows us to move tui functionality into a sub-commandentropy tui
AND sets this as the default command that is run (if no sub-command is called).This resolves almost all the problems in #265 and means that we can have