mirror of
https://codeberg.org/andyscott/weather-cli.git
synced 2024-12-21 12:43:09 -05:00
Minor changes to user prompts
This commit is contained in:
parent
e68ede2c98
commit
9296d7a629
2 changed files with 5 additions and 5 deletions
|
@ -16,7 +16,7 @@ func advancedMenu(app *application) {
|
|||
|
||||
fmt.Print("\nAdvanced Menu\n-------------\n\n")
|
||||
|
||||
fmt.Println("1. Change units (Default: Imperial)")
|
||||
fmt.Printf("1. Change units (Default: imperial; Current: %s)\n", app.Config.Units)
|
||||
fmt.Println("2. Enter precise location")
|
||||
fmt.Print("0. Back\n\n")
|
||||
|
||||
|
|
|
@ -37,20 +37,20 @@ func getLocation(app *application) {
|
|||
|
||||
func getPreciseLocation(app *application) {
|
||||
|
||||
fmt.Print("\nEnter longitude: ")
|
||||
fmt.Print("\nEnter latitude: ")
|
||||
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
input, err := reader.ReadString('\n')
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
app.Config.Longitude = strings.TrimSuffix(input, "\n")
|
||||
app.Config.Latitude = strings.TrimSuffix(input, "\n")
|
||||
|
||||
fmt.Print("\nEnter latitude: ")
|
||||
fmt.Print("\nEnter longitude: ")
|
||||
|
||||
input, err = reader.ReadString('\n')
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
app.Config.Latitude = strings.TrimSuffix(input, "\n")
|
||||
app.Config.Longitude = strings.TrimSuffix(input, "\n")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue