Closed fishgrimsby closed 1 year ago
@theurichde Thanks for looking so promptly. You're absolutely right, it makes no sense to pass them all! I'll have a play and push some changes
@theurichde I've made a change as requested. It's perhaps not quite as you suggested as I didn't understand about appending it later. If it does need doing a different way then let me know and I'll give it a go!
Hi @fishgrimsby!
What I meant by appending the flags, is, that you could have added those both flags into a separate configFlags slice, pass those to the GenerateConfigAction and append them directly to initialFlags like below:
configFlags := []cli.Flag{ [startURL and region here] }
initialFlags := []cli.Flag{ [all other needed flags go here] }
initialFlags = append(initialFlags, configFlags...)
This would be less errorprone as your current implementation depends on the order of the flags added, which could break when a new flag gets inserted before the e.g. start-url flag
@theurichde That makes sense, I think i was taking the word extract too literally 😄 I've made the change as you suggested, I've reversed the order of the append to maintain the order of the initflags. Thanks for the help! 👍
Thank you! Merge incoming 🎈
This PR will allow a config file to be generated without prompting the user for answers if they provide
--start-url
or--region
as command options toconfig generate
. If either one or both of these are omitted the user is prompted for an answer in the usual way.It is an attempted implementation for #104