@@ -68,42 +68,36 @@ static int parse_options_cmd_bundle(int argc,
6868}
6969
7070static int cmd_bundle_create (int argc , const char * * argv , const char * prefix ) {
71- int all_progress_implied = 1 ;
72- int progress = isatty (STDERR_FILENO );
73- struct strvec pack_opts ;
71+ struct strvec pack_opts = STRVEC_INIT ;
7472 int version = -1 ;
7573 int ret ;
7674 struct option options [] = {
77- OPT_SET_INT ('q' , "quiet" , & progress ,
78- N_ ("do not show progress meter" ), 0 ),
79- OPT_SET_INT (0 , "progress" , & progress ,
80- N_ ("show progress meter" ), 1 ),
81- OPT_SET_INT_F (0 , "all-progress" , & progress ,
82- N_ ("historical; same as --progress" ), 2 ,
83- PARSE_OPT_HIDDEN ),
84- OPT_HIDDEN_BOOL (0 , "all-progress-implied" ,
85- & all_progress_implied ,
86- N_ ("historical; does nothing" )),
75+ OPT_PASSTHRU_ARGV ('q' , "quiet" , & pack_opts , NULL ,
76+ N_ ("do not show progress meter" ),
77+ PARSE_OPT_NOARG ),
78+ OPT_PASSTHRU_ARGV (0 , "progress" , & pack_opts , NULL ,
79+ N_ ("show progress meter" ),
80+ PARSE_OPT_NOARG ),
81+ OPT_PASSTHRU_ARGV (0 , "all-progress" , & pack_opts , NULL ,
82+ N_ ("historical; same as --progress" ),
83+ PARSE_OPT_NOARG | PARSE_OPT_HIDDEN ),
84+ OPT_PASSTHRU_ARGV (0 , "all-progress-implied" , & pack_opts , NULL ,
85+ N_ ("historical; does nothing" ),
86+ PARSE_OPT_NOARG | PARSE_OPT_HIDDEN ),
8787 OPT_INTEGER (0 , "version" , & version ,
8888 N_ ("specify bundle format version" )),
8989 OPT_END ()
9090 };
9191 char * bundle_file ;
9292
93+ if (isatty (STDERR_FILENO ))
94+ strvec_push (& pack_opts , "--progress" );
95+ strvec_push (& pack_opts , "--all-progress-implied" );
96+
9397 argc = parse_options_cmd_bundle (argc , argv , prefix ,
9498 builtin_bundle_create_usage , options , & bundle_file );
9599 /* bundle internals use argv[1] as further parameters */
96100
97- strvec_init (& pack_opts );
98- if (progress == 0 )
99- strvec_push (& pack_opts , "--quiet" );
100- else if (progress == 1 )
101- strvec_push (& pack_opts , "--progress" );
102- else if (progress == 2 )
103- strvec_push (& pack_opts , "--all-progress" );
104- if (progress && all_progress_implied )
105- strvec_push (& pack_opts , "--all-progress-implied" );
106-
107101 if (!startup_info -> have_repository )
108102 die (_ ("Need a repository to create a bundle." ));
109103 ret = !!create_bundle (the_repository , bundle_file , argc , argv , & pack_opts , version );
0 commit comments