mirror of https://github.com/miguelmota/cointop
add config, clean, and reset flags
parent
9b0670f11b
commit
22d551b3b4
@ -0,0 +1,25 @@
|
|||||||
|
# Changelog
|
||||||
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [1.1.2] - 2018-12-30
|
||||||
|
### Fixed
|
||||||
|
- Paginate CoinMarketCap V1 API responses due to their backward-incompatible update
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- `-clean` flag to clean cache
|
||||||
|
- `-reset` flag to clean cache and delete config
|
||||||
|
- `-config` flag to use a different specified config file
|
||||||
|
|
||||||
|
## [1.1.1] - 2018-12-26
|
||||||
|
### Changed
|
||||||
|
- Use go modules instead of dep
|
||||||
|
|
||||||
|
## [1.1.0] - 2018-12-25
|
||||||
|
### Added
|
||||||
|
- Basic portfolio functionality
|
||||||
|
- `P` keyboard shortcut to toggle portfolio view
|
||||||
|
- `e` keyboard shortcut to edit portfolio holdings
|
||||||
|
- `[portfolio]` TOML config holdings list
|
@ -0,0 +1,38 @@
|
|||||||
|
package cmd
|
||||||
|
|
||||||
|
import (
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/miguelmota/cointop/cointop"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Run ...
|
||||||
|
func Run() {
|
||||||
|
var v, ver, test, clean, reset bool
|
||||||
|
var config string
|
||||||
|
flag.BoolVar(&v, "v", false, "Version")
|
||||||
|
flag.BoolVar(&ver, "version", false, "Version")
|
||||||
|
flag.BoolVar(&test, "test", false, "Run test")
|
||||||
|
flag.BoolVar(&clean, "clean", false, "Clean cache")
|
||||||
|
flag.BoolVar(&reset, "reset", false, "Reset config")
|
||||||
|
flag.StringVar(&config, "config", "", "Config filepath")
|
||||||
|
flag.Parse()
|
||||||
|
if v || ver {
|
||||||
|
fmt.Printf("cointop v%s", cointop.Version())
|
||||||
|
} else if test {
|
||||||
|
doTest()
|
||||||
|
} else if clean {
|
||||||
|
cointop.Clean()
|
||||||
|
} else if reset {
|
||||||
|
cointop.Reset()
|
||||||
|
} else {
|
||||||
|
cointop.NewCointop(&cointop.Config{
|
||||||
|
ConfigFilepath: config,
|
||||||
|
}).Run()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func doTest() {
|
||||||
|
cointop.NewCointop(nil).Exit()
|
||||||
|
}
|
@ -1,27 +1,9 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
"github.com/miguelmota/cointop/cmd"
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"github.com/miguelmota/cointop/cointop"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
var v, ver, test bool
|
cmd.Run()
|
||||||
flag.BoolVar(&v, "v", false, "Version")
|
|
||||||
flag.BoolVar(&ver, "version", false, "Version")
|
|
||||||
flag.BoolVar(&test, "test", false, "Run test")
|
|
||||||
flag.Parse()
|
|
||||||
if v || ver {
|
|
||||||
fmt.Printf("cointop v%s", cointop.Version())
|
|
||||||
} else if test {
|
|
||||||
doTest()
|
|
||||||
} else {
|
|
||||||
cointop.New().Run()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func doTest() {
|
|
||||||
cointop.New().Exit()
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
package coingecko
|
||||||
|
|
||||||
|
// TODO
|
Loading…
Reference in New Issue