@@ -85,7 +85,7 @@ pub fn interactive_init() -> inquire::error::InquireResult<init_vars> {
8585 . prompt ( ) ?
8686 } ,
8787
88- // TODO: do we actually want to be in charge of these credentials vs letting the container building utility take care of it ?
88+ // TODO: do we actually want to be in charge of these credentials vs expecting the local building utility already be logged in ?
8989 registry_build_pass : {
9090 inquire:: Password :: new ( "Container registry 'build' password:" )
9191 . with_help_message ( "The password to the 'build' user account" ) // TODO: could this support username:pat too?
@@ -115,33 +115,29 @@ pub fn interactive_init() -> inquire::error::InquireResult<init_vars> {
115115 let mut again = inquire:: Confirm :: new ( "Do you want to provide a difficulty class?" )
116116 . with_default ( false )
117117 . prompt ( ) ?;
118+ println ! ( "Challenge points are dynamic. For a static challenge, simply set minimum and maximum points to the same value." ) ;
118119 let mut points_ranks: Vec < points > = Vec :: new ( ) ;
119120 while again {
120121 let points_obj = points {
121- // TODO: theres no reason these need to be numbers instead of open strings, e.g. for "easy"
122122 difficulty : {
123- inquire:: CustomType :: < u64 > :: new ( "Difficulty rank:" )
124- // default parser calls std::u64::from_str
125- . with_error_message ( "Please type a valid number." )
126- . with_help_message ( "The rank of the difficulty class as an unsigned integer, with lower numbers being \" easier.\" " )
123+ inquire:: Text :: new ( "Difficulty class:" )
124+ . with_validator ( inquire:: required!( "Please provide a name." ) )
125+ . with_help_message ( "The name of the difficulty class." )
127126 . with_placeholder ( example_values:: POINTS_DIFFICULTY )
128127 . prompt ( ) ?
129- . to_string ( )
130128 } ,
131129 // TODO: support static-point challenges
132130 min : {
133131 inquire:: CustomType :: < u64 > :: new ( "Minimum points:" )
134- // default parser calls std::u64::from_str
135- . with_error_message ( "Please type a valid number." )
132+ . with_error_message ( "Please type a valid number." ) // default parser calls std::u64::from_str
136133 . with_help_message ( "Challenge points are dynamic. The minimum number of points that challenges within this difficulty class are worth." )
137134 . with_placeholder ( example_values:: POINTS_MIN )
138135 . prompt ( ) ?
139136 . to_string ( )
140137 } ,
141138 max : {
142139 inquire:: CustomType :: < u64 > :: new ( "Maximum points:" )
143- // default parser calls std::u64::from_str
144- . with_error_message ( "Please type a valid number." )
140+ . with_error_message ( "Please type a valid number." ) // default parser calls std::u64::from_str
145141 . with_help_message ( "The maximum number of points that challenges within this difficulty class are worth." )
146142 . with_placeholder ( example_values:: POINTS_MAX )
147143 . prompt ( ) ?
0 commit comments