@@ -60,6 +60,7 @@ fn write_command_func(script: &mut ShStream, fname: &str, command: &clap::Comman
60
60
& f ! ( "local long_flags=\" {long_flags}\" " ) ,
61
61
& f ! ( "local options=\" {options_pattern}\" " ) ,
62
62
"local pos_index=0" ,
63
+ "local __branch" ,
63
64
] ) ;
64
65
65
66
if !subcommand_names. as_ref ( ) . is_empty ( ) {
@@ -83,6 +84,17 @@ fn write_command_func(script: &mut ShStream, fname: &str, command: &clap::Comman
83
84
script. lines ( & [ "cmd_index=$i" , & f ! ( "{fname}-{subcommand_name}; return;;" ) ] ) ;
84
85
script. dedent ( ) ;
85
86
}
87
+ script. lines ( & [
88
+ "-b|--branch|-B|--ref-branch)" ,
89
+ " if (( i < cword )); then" ,
90
+ " __branch=\" ${words[i+1]}\" " ,
91
+ " fi" ,
92
+ " ;;" ,
93
+ "--branch=*|--ref-branch=*)" ,
94
+ " __branch=\" ${words[i]}\" " ,
95
+ " __branch=\" ${__branch#*=}\" " ,
96
+ " ;;" ,
97
+ ] ) ;
86
98
if !flags_pattern. as_ref ( ) . is_empty ( ) {
87
99
script. lines ( & [ & f ! ( "{flags_pattern})" ) , " ;;" ] ) ;
88
100
}
@@ -549,29 +561,34 @@ _remotes ()
549
561
test "$g" && __git show-ref | grep ' refs/remotes/' | sed 's,.* refs/remotes/,,'
550
562
}
551
563
564
+ _stg_series ()
565
+ {
566
+ __stg series ${__branch:+"--branch=${__branch}"} "$@"
567
+ }
568
+
552
569
_all_patches ()
553
570
{
554
- __stg series --no-description --noprefix --all
571
+ _stg_series --no-description --noprefix --all
555
572
}
556
573
557
574
_applied_patches ()
558
575
{
559
- __stg series --no-description --noprefix --applied
576
+ _stg_series --no-description --noprefix --applied
560
577
}
561
578
562
579
_unapplied_patches ()
563
580
{
564
- __stg series --no-description --noprefix --unapplied
581
+ _stg_series --no-description --noprefix --unapplied
565
582
}
566
583
567
584
_visible_patches ()
568
585
{
569
- __stg series --no-description --noprefix --applied --unapplied
586
+ _stg_series --no-description --noprefix --applied --unapplied
570
587
}
571
588
572
589
_hidden_patches ()
573
590
{
574
- __stg series --no-description --noprefix --hidden
591
+ _stg_series --no-description --noprefix --hidden
575
592
}
576
593
577
594
_conflicting_files ()
0 commit comments