@@ -78,6 +78,7 @@ type SQLCmdArguments struct {
78
78
EnableColumnEncryption bool
79
79
ChangePassword string
80
80
ChangePasswordAndExit string
81
+ DisablePrompts bool
81
82
// Keep Help at the end of the list
82
83
Help bool
83
84
}
@@ -438,6 +439,7 @@ func setFlags(rootCmd *cobra.Command, args *SQLCmdArguments) {
438
439
rootCmd .Flags ().BoolVarP (& args .EnableColumnEncryption , "enable-column-encryption" , "g" , false , localizer .Sprintf ("Enable column encryption" ))
439
440
rootCmd .Flags ().StringVarP (& args .ChangePassword , "change-password" , "z" , "" , localizer .Sprintf ("New password" ))
440
441
rootCmd .Flags ().StringVarP (& args .ChangePasswordAndExit , "change-password-exit" , "Z" , "" , localizer .Sprintf ("New password and exit" ))
442
+ rootCmd .Flags ().BoolVar (& args .DisablePrompts , "disable-prompts" , false , localizer .Sprintf ("Disables line prompts when running as a subprocess" ))
441
443
}
442
444
443
445
func setScriptVariable (v string ) string {
@@ -738,6 +740,7 @@ func run(vars *sqlcmd.Variables, args *SQLCmdArguments) (int, error) {
738
740
s .SetupCloseHandler ()
739
741
defer s .StopCloseHandler ()
740
742
s .UnicodeOutputFile = args .UnicodeOutputFile
743
+ s .DisablePrompts = args .DisablePrompts
741
744
742
745
if args .DisableCmd != nil {
743
746
s .Cmd .DisableSysCommands (args .errorOnBlockedCmd ())
0 commit comments