@@ -18,6 +18,7 @@ static void set_destination_and_source(struct Prompt *p, char *dest_src);
1818static void set_template (struct Prompt * p , char * template );
1919static void set_title (struct Prompt * p , char * title );
2020static void set_assignees (struct Prompt * p , char * assignees );
21+ static void set_labels (struct Prompt * p , char * labels );
2122static void assure_query_param_support (struct Prompt * p );
2223static void warn_missing_branches (struct Prompt * p );
2324
@@ -213,6 +214,8 @@ static void handle_newpr_options(struct Prompt *p) {
213214 set_title (p , p -> opts [i ].value );
214215 } else if (strcmp (p -> opts [i ].key , "--assignees" ) == 0 ) {
215216 set_assignees (p , p -> opts [i ].value );
217+ } else if (strcmp (p -> opts [i ].key , "--labels" ) == 0 ) {
218+ set_labels (p , p -> opts [i ].value );
216219 }
217220 }
218221
@@ -256,6 +259,13 @@ static void set_assignees(struct Prompt *p, char *assignees) {
256259 strcat (p -> instruction , assignees );
257260}
258261
262+ static void set_labels (struct Prompt * p , char * labels ) {
263+ assure_query_param_support (p );
264+
265+ strcat (p -> instruction , "&labels=" );
266+ strcat (p -> instruction , labels );
267+ }
268+
259269static void assure_query_param_support (struct Prompt * p ) {
260270 if (strstr (p -> instruction , "?expand=1" ) != NULL ) return ;
261271
0 commit comments