Closed radiovisual closed 7 years ago
This is going to be really handy. No changes in the API, looks good 🗡
@brh55 , do you want to impose a default profile, or leave all profiles blank and let the user manage from nothing?
@radiovisual By imposing do you mean the first time they initiate the bin, their --from
and --to
are stored in the default profile?
no, I was just thinking of having a default already defined. One that we think might be interesting from the more common cryptos.
but the more I think about it, the less I like the idea of an imposed default. So unless you are in love with the idea, let's skip it.
what I wouldn't mind, though, is creating a profile based on the most popular crypto pairs, like, if I were to do a profile named "top5", or "top-5" which listed off the top-five most popular cryptos along with USD,EUR
Ahh I see, well that wouldn't be too bad, but I wouldn't stress over it. I really like that idea of predefined profiles. That would be perfect for just exploring different ones.
What would be neat is a way to point to a script to dynamically create the symbols. Thus you could write something that fetched from an external API and would be dynamic everytime.
I haven't done profiles in a CLI, what are the general steps to accomplishing this? I'm assuming some sort of file written to a path/directory?
what are the general steps to accomplishing this? I'm assuming some sort of file written to a path/directory?
Yes, that is the approach I have in mind. I am stealing ideas from NPM, and just using a profiles.json
file that stores the profile data in the module directory.
What would be neat is a way to point to a script to dynamically create the symbols
Can you explain a bit more? I am not sure I follow.
That would be perfect for just exploring different ones [predefined profiles]
Ok, then we can revisit this once profile support has been added, and then discuss any predefined ideas we might have in a new thread.
Ok, profile support has been added. Please see the updated README to see the final API, but basically, I have made it so that you don't have to specify a flag or option when loading a profile name, so if you have a profile named stuff
, then you just have to type:
$ ccoin stuff
Also, if a default
profile has been supplied, then simply running:
$ ccoin
will automatically run the default profile.
To save a profile
--save-as
:To load a profile
-p
:To set a default:
To create a profile AND make it the default:
Once a default profile has been saved, no parameters are needed:
To list your profiles
-p
without parameters:@brh55, @rightlag, please feel free to tweak this API, I just threw this together quickly.