update readme

pull/25/head 1.1.2
Miguel Mota 5 years ago
parent 22d551b3b4
commit b91ef2944a

@ -414,6 +414,12 @@ defaultView = "default"
v = "sort_column_24h_volume"
```
You may specify a different config file to use by using the `-config` flag:
```bash
cointop -config="/path/to/config"
```
## List of actions
This are the action keywords you may use in the config file to change what the shortcut keys do.

@ -100,6 +100,8 @@ type Config struct {
ConfigFilepath string
}
var defaultConfigPath = "~/.cointop/config"
// NewCointop initializes cointop
func NewCointop(config *Config) *Cointop {
var debug bool
@ -107,7 +109,7 @@ func NewCointop(config *Config) *Cointop {
debug = true
}
configFilepath := "~/.cointop/config"
configFilepath := defaultConfigPath
if config != nil {
if config.ConfigFilepath != "" {
configFilepath = config.ConfigFilepath
@ -275,9 +277,8 @@ func Clean() {
func Reset() {
Clean()
homedir := userHomeDir()
// default config path
configPath := fmt.Sprintf("%s%s", homedir, "/.cointop")
configPath := fmt.Sprintf("%s%s", userHomeDir(), "/.cointop")
if _, err := os.Stat(configPath); !os.IsNotExist(err) {
fmt.Printf("removing %s\n", configPath)
if err := os.RemoveAll(configPath); err != nil {

Loading…
Cancel
Save