@@ -9,9 +9,20 @@ use std::io;
99use tui:: backend:: CrosstermBackend ;
1010use tui:: Terminal ;
1111
12- /// headjack - Terminal UI 3D volume brain imaging viewer
12+
13+ static LONG_ABOUT : & ' static str =
14+ "headjack - Interactive NIfTI Viewer for the Terminal\n \n \
15+ Interactive controls:\n \
16+ \t - Arrow keys / WSAD: Move slice (Post.-Ant. / Left-Right)\n \
17+ \t \t Navigate metadata\n \
18+ \t - ZX: Move slice (Inf.-Sup.)\n \
19+ \t - Tab: Toggle metadata view\n \
20+ \t - C: Toggle color map\n \
21+ \t - Q / Esc / Ctrl+C: Quit";
22+
23+ /// headjack - Interactive NIfTI Viewer for the Terminal
1324#[ derive( Parser , Debug ) ]
14- #[ command( author, version, about, long_about = None ) ]
25+ #[ command( author, version, about, long_about= LONG_ABOUT ) ]
1526struct Args {
1627 /// Image file name (.nii or .nii.gz)
1728 #[ arg( index = 1 ) ]
@@ -20,26 +31,24 @@ struct Args {
2031 /// ANSI color mode for terminals not supporting true color (24bit).
2132 #[ arg( short, long, action) ]
2233 ansi : bool ,
23-
24- /// Black and white color mode for terminals not supporting any color (what year is this?) .
34+
35+ /// Verbose (debug) output .
2536 #[ arg( short, long, action) ]
26- bw : bool ,
37+ verbose : bool ,
2738}
2839
2940fn main ( ) -> anyhow:: Result < ( ) > {
3041 // Read args
3142 let args = Args :: parse ( ) ;
3243
33- let color_mode = if args. bw {
34- ColorMode :: Bw
35- } else if args. ansi {
44+ let color_mode = if args. ansi {
3645 ColorMode :: Ansi256
3746 } else {
3847 ColorMode :: TrueColor
3948 } ;
4049
4150 // Create an application.
42- let mut app = App :: new ( & args. input , color_mode)
51+ let mut app = App :: new ( args . verbose , & args. input , color_mode)
4352 . map_err ( |e| anyhow ! ( e) )
4453 . with_context ( || format ! ( "Failed to load data '{}'" , & args. input) ) ?;
4554
0 commit comments