@@ -8,24 +8,16 @@ use butane_cli::{
88 detach_latest_migration, embed, get_migrations, handle_error, init, list_backends,
99 list_migrations, make_migration, migrate, regenerate_migrations, remove_backend, unmigrate,
1010} ;
11- use clap:: { ArgAction , Parser , Subcommand } ;
11+ use clap:: { ArgAction , CommandFactory , Parser , Subcommand } ;
1212
1313#[ derive( Parser ) ]
1414#[ command( author, version, about = "Manages butane database migrations." ) ]
1515#[ command( propagate_version = true , max_term_width = 80 ) ]
1616struct Cli {
1717 #[ command( subcommand) ]
1818 command : Commands ,
19- #[ cfg( not( feature = "clap-markdown" ) ) ]
2019 #[ arg( short = 'p' , long, default_value=butane_cli:: base_dir( ) . into_os_string( ) ) ]
2120 path : PathBuf ,
22- #[ cfg( feature = "clap-markdown" ) ]
23- #[ arg(
24- short = 'p' ,
25- long,
26- default_value = "<detected project containing .butane directory>"
27- ) ]
28- path : PathBuf ,
2921 #[ command( flatten) ]
3022 verbose : clap_verbosity_flag:: Verbosity ,
3123 #[ cfg( feature = "clap-markdown" ) ]
@@ -150,7 +142,12 @@ fn main() {
150142
151143 #[ cfg( feature = "clap-markdown" ) ]
152144 if cli. markdown_help {
153- clap_markdown:: print_help_markdown :: < Cli > ( ) ;
145+ let command = Cli :: command ( ) ;
146+
147+ let command = command. mut_arg ( "path" , |arg| {
148+ arg. default_value ( "<detected project containing .butane directory>" )
149+ } ) ;
150+ clap_markdown:: print_help_markdown_command ( & command) ;
154151 std:: process:: exit ( 0 ) ;
155152 }
156153
0 commit comments