| 132 | } |
| 133 | |
| 134 | func inputFlags(content []byte) { |
| 135 | reader := bufio.NewReader(os.Stdin) |
| 136 | if *username == "" && bytes.Contains(content, []byte("_username_")) { |
| 137 | fmt.Print("A _username_ is used in this template, please specify: ") |
| 138 | *username, _ = reader.ReadString('\n') |
| 139 | *username = strings.TrimSpace(*username) |
| 140 | } |
| 141 | if *researcher == "" && bytes.Contains(content, []byte("_researcher_")) { |
| 142 | fmt.Print("A _researcher_ is used in this template, please specify: ") |
| 143 | *researcher, _ = reader.ReadString('\n') |
| 144 | *researcher = strings.TrimSpace(*researcher) |
| 145 | |
| 146 | } |
| 147 | if *program == "" && bytes.Contains(content, []byte("_program_")) { |
| 148 | fmt.Print("A _program_ is used in this template, please specify: ") |
| 149 | *program, _ = reader.ReadString('\n') |
| 150 | *program = strings.TrimSpace(*program) |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | // checkError if error is not nil and exiting if error found |
| 155 | func checkError(err error) { |