1717#include "utf8.h"
1818
1919static const char * const repo_usage [] = {
20- "git repo info [--format=(keyvalue |nul) | -z] [--all | <key>...]" ,
21- "git repo structure [--format=(table|keyvalue |nul) | -z]" ,
20+ "git repo info [--format=(lines |nul) | -z] [--all | <key>...]" ,
21+ "git repo structure [--format=(table|lines |nul) | -z]" ,
2222 NULL
2323};
2424
2525typedef int get_value_fn (struct repository * repo , struct strbuf * buf );
2626
2727enum output_format {
2828 FORMAT_TABLE ,
29- FORMAT_KEYVALUE ,
29+ FORMAT_LINES ,
3030 FORMAT_NUL_TERMINATED ,
3131};
3232
@@ -91,7 +91,7 @@ static void print_field(enum output_format format, const char *key,
9191 const char * value )
9292{
9393 switch (format ) {
94- case FORMAT_KEYVALUE :
94+ case FORMAT_LINES :
9595 printf ("%s=" , key );
9696 quote_c_style (value , NULL , stdout , 0 );
9797 putchar ('\n' );
@@ -157,8 +157,8 @@ static int parse_format_cb(const struct option *opt,
157157 * format = FORMAT_NUL_TERMINATED ;
158158 else if (!strcmp (arg , "nul" ))
159159 * format = FORMAT_NUL_TERMINATED ;
160- else if (!strcmp (arg , "keyvalue " ))
161- * format = FORMAT_KEYVALUE ;
160+ else if (!strcmp (arg , "lines " ))
161+ * format = FORMAT_LINES ;
162162 else if (!strcmp (arg , "table" ))
163163 * format = FORMAT_TABLE ;
164164 else
@@ -170,7 +170,7 @@ static int parse_format_cb(const struct option *opt,
170170static int cmd_repo_info (int argc , const char * * argv , const char * prefix ,
171171 struct repository * repo )
172172{
173- enum output_format format = FORMAT_KEYVALUE ;
173+ enum output_format format = FORMAT_LINES ;
174174 int all_keys = 0 ;
175175 struct option options [] = {
176176 OPT_CALLBACK_F (0 , "format" , & format , N_ ("format" ),
@@ -185,7 +185,8 @@ static int cmd_repo_info(int argc, const char **argv, const char *prefix,
185185 };
186186
187187 argc = parse_options (argc , argv , prefix , options , repo_usage , 0 );
188- if (format != FORMAT_KEYVALUE && format != FORMAT_NUL_TERMINATED )
188+
189+ if (format != FORMAT_LINES && format != FORMAT_NUL_TERMINATED )
189190 die (_ ("unsupported output format" ));
190191
191192 if (all_keys && argc )
@@ -671,7 +672,7 @@ static int cmd_repo_structure(int argc, const char **argv, const char *prefix,
671672 stats_table_setup_structure (& table , & stats );
672673 stats_table_print_structure (& table );
673674 break ;
674- case FORMAT_KEYVALUE :
675+ case FORMAT_LINES :
675676 structure_keyvalue_print (& stats , '=' , '\n' );
676677 break ;
677678 case FORMAT_NUL_TERMINATED :
0 commit comments