@@ -885,6 +885,7 @@ class CommonArgs:
885885 hyperlinks : bool
886886 verbose : bool
887887 branch_name_template : str
888+ show_tips : bool
888889
889890 @classmethod
890891 def from_args (cls , args : argparse .Namespace ) -> CommonArgs :
@@ -896,6 +897,7 @@ def from_args(cls, args: argparse.Namespace) -> CommonArgs:
896897 args .hyperlinks ,
897898 args .verbose ,
898899 args .branch_name_template ,
900+ args .show_tips ,
899901 )
900902
901903
@@ -976,12 +978,13 @@ def deduce_base(args: CommonArgs) -> CommonArgs:
976978 args .hyperlinks ,
977979 args .verbose ,
978980 args .branch_name_template ,
981+ args .show_tips ,
979982 )
980983
981984
982985def print_tips_after_export (st : list [StackEntry ], args : CommonArgs ) -> None :
983986 stack_size = len (st )
984- if stack_size == 0 :
987+ if stack_size == 0 or not args . show_tips :
985988 return
986989
987990 top_commit = args .head
@@ -1377,7 +1380,7 @@ def command_abandon(args: CommonArgs) -> None:
13771380# ===----------------------------------------------------------------------=== #
13781381def print_tips_after_view (st : list [StackEntry ], args : CommonArgs ) -> None :
13791382 stack_size = len (st )
1380- if stack_size == 0 :
1383+ if stack_size == 0 or not args . show_tips :
13811384 return
13821385
13831386 ready_to_land = all (not e .has_missing_info () for e in st )
@@ -1522,6 +1525,12 @@ def create_argparser(
15221525 default = config .get ("repo" , "branch_name_template" , fallback = "$USERNAME/stack" ),
15231526 help = "A template for names of the branches stack-pr would use." ,
15241527 )
1528+ common_parser .add_argument (
1529+ "--show-tips" ,
1530+ action = argparse .BooleanOptionalAction ,
1531+ default = config .getboolean ("common" , "show_tips" , fallback = True ),
1532+ help = "Show or hide usage tips after commands." ,
1533+ )
15251534
15261535 parser_submit = subparsers .add_parser (
15271536 "submit" ,
0 commit comments