+
+int cmd_cat_file(int argc, const char **argv, const char *prefix)
+{
+ int opt;
+ const char *exp_type, *obj_name;
+
+ git_config(git_default_config);
+ if (argc != 3)
+ usage("git-cat-file [-t|-s|-e|-p|<type>] <sha1>");
+ exp_type = argv[1];
+ obj_name = argv[2];
+
+ opt = 0;
+ if ( exp_type[0] == '-' ) {
+ opt = exp_type[1];
+ if ( !opt || exp_type[2] )
+ opt = -1; /* Not a single character option */
+ }
+
+ return cat_one_file(opt, exp_type, obj_name);
+}