File tree 3 files changed +32
-1
lines changed
3 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## bpaf [ 0.9.13] - Unreleased
4
4
- You can now use ` fallback_to_usage ` in derive macro for options and subcommands
5
+ - Bugfixes related to shell completion and file masks
6
+ thanks @ozwaldorf
7
+ - ` not_strict ` restriction for positional items (TODO - check the docs)
8
+ thanks @ozwaldorf
9
+
5
10
6
11
## bpaf [ 0.9.12] - 2024-04-29
7
12
- better error messages
Original file line number Diff line number Diff line change @@ -507,7 +507,7 @@ impl ParsedEnumBranch {
507
507
508
508
if let Some ( opts_at) = has_options {
509
509
if fallback_usage {
510
- attrs. push ( EAttr :: FallbackUsage ) ;
510
+ attrs. insert ( opts_at , EAttr :: FallbackUsage ) ;
511
511
}
512
512
513
513
if let Some ( h) = std:: mem:: take ( & mut help) {
Original file line number Diff line number Diff line change @@ -72,6 +72,32 @@ fn fallback_usage_subcommand() {
72
72
assert_eq ! ( input. to_token_stream( ) . to_string( ) , expected. to_string( ) ) ;
73
73
}
74
74
75
+ #[ test]
76
+ fn fallback_usage_lut ( ) {
77
+ let input: Top = parse_quote ! {
78
+ #[ bpaf( options) ]
79
+ enum Lutgen {
80
+ /// descr
81
+ #[ bpaf( command, fallback_to_usage) ]
82
+ Generate ,
83
+ }
84
+ } ;
85
+
86
+ let expected = quote ! {
87
+ fn lutgen( ) -> :: bpaf:: OptionParser <Lutgen > {
88
+ #[ allow( unused_imports) ]
89
+ use :: bpaf:: Parser ;
90
+ :: bpaf:: pure( Lutgen :: Generate )
91
+ . to_options( )
92
+ . descr( "descr" )
93
+ . fallback_to_usage( )
94
+ . command( "generate" )
95
+ . to_options( )
96
+ }
97
+ } ;
98
+ assert_eq ! ( input. to_token_stream( ) . to_string( ) , expected. to_string( ) ) ;
99
+ }
100
+
75
101
#[ test]
76
102
fn top_struct_construct ( ) {
77
103
let top: Top = parse_quote ! {
You can’t perform that action at this time.
0 commit comments