File tree 2 files changed +29
-2
lines changed
2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -354,6 +354,9 @@ pub struct Args {
354
354
hide = !cfg!( feature = "bitbucket" ) ,
355
355
) ]
356
356
pub bitbucket_repo : Option < RemoteValue > ,
357
+ /// Launches the TUI.
358
+ #[ arg( long) ]
359
+ pub tui : bool ,
357
360
}
358
361
359
362
/// Custom type for the remote value.
Original file line number Diff line number Diff line change @@ -4,9 +4,16 @@ use git_cliff::logger;
4
4
use git_cliff_core:: error:: Result ;
5
5
use std:: env;
6
6
use std:: fs:: File ;
7
- use std:: io;
7
+ use std:: io:: {
8
+ self ,
9
+ } ;
10
+ use std:: os:: unix:: process:: CommandExt ;
8
11
use std:: path:: Path ;
9
- use std:: process;
12
+ use std:: process:: {
13
+ self ,
14
+ Command ,
15
+ Stdio ,
16
+ } ;
10
17
11
18
/// Profiler.
12
19
#[ cfg( feature = "profiler" ) ]
@@ -15,6 +22,23 @@ mod profiler;
15
22
fn main ( ) -> Result < ( ) > {
16
23
// Parse the command line arguments
17
24
let args = Args :: parse ( ) ;
25
+
26
+ // Launch the TUI if the flag is set.
27
+ if args. tui {
28
+ let env_args = env:: args ( ) . collect :: < Vec < String > > ( ) ;
29
+ let error = Command :: new ( "git-cliff-tui" )
30
+ . stdout ( Stdio :: inherit ( ) )
31
+ . args (
32
+ & env_args[ 1 ..]
33
+ . iter ( )
34
+ . filter ( |arg| * arg != "--tui" )
35
+ . collect :: < Vec < & String > > ( ) ,
36
+ )
37
+ . exec ( ) ;
38
+ return Err ( error. into ( ) ) ;
39
+ }
40
+
41
+ // Enable logging.
18
42
if args. verbose == 1 {
19
43
env:: set_var ( "RUST_LOG" , "debug" ) ;
20
44
} else if args. verbose > 1 {
You can’t perform that action at this time.
0 commit comments