@@ -108,6 +108,7 @@ const prettifyLogs = (logLevel?: string) => {
108108
109109const startRepl = async ( options : {
110110 logging : {
111+ printOptions : boolean ;
111112 logLevel : LogLevel ;
112113 logStyle : LogStyle ;
113114 } ;
@@ -118,13 +119,17 @@ const startRepl = async (options: {
118119 } ;
119120 connectionString : string | undefined ;
120121} ) => {
121- console . log ( JSON . stringify ( options ) ) ;
122122 // TODO: This will change when we have proper tracing and logging config
123123 // For now, that's enough
124124 setLogLevel ( process . env . DUMBO_LOG_LEVEL ?? options . logging . logLevel ) ;
125125 setLogStyle ( process . env . DUMBO_LOG_STYLE ?? options . logging . logStyle ) ;
126126
127- console . log ( chalk . green ( 'Starting Pongo Shell (version: 0.16.0)' ) ) ;
127+ console . log ( chalk . green ( 'Starting Pongo Shell (version: 0.16.1)' ) ) ;
128+
129+ if ( options . logging . printOptions ) {
130+ console . log ( chalk . green ( 'With Options:' ) ) ;
131+ console . log ( prettyJson ( options ) ) ;
132+ }
128133
129134 const connectionString =
130135 options . connectionString ??
@@ -247,6 +252,7 @@ interface ShellOptions {
247252 logStyle ?: string ;
248253 logLevel ?: string ;
249254 prettyLog ?: boolean ;
255+ printOptions ?: boolean ;
250256}
251257
252258const shellCommand = new Command ( 'shell' )
@@ -269,6 +275,7 @@ const shellCommand = new Command('shell')
269275 '-no-migrations, --disable-auto-migrations' ,
270276 'Disable automatic migrations' ,
271277 )
278+ . option ( '-o, --print-options' , 'Print shell options' )
272279 . option (
273280 '-ll, --log-level <logLevel>' ,
274281 'Log level: DISABLED, INFO, LOG, WARN, ERROR' ,
@@ -277,12 +284,12 @@ const shellCommand = new Command('shell')
277284 . option ( '-ls, --log-style' , 'Log style: RAW, PRETTY' , 'RAW' )
278285 . option ( '-p, --pretty-log' , 'Turn on logging with prettified output' )
279286 . action ( async ( options : ShellOptions ) => {
280- console . log ( JSON . stringify ( options ) ) ;
281287 const { collection, database } = options ;
282288 const connectionString = options . connectionString ;
283289
284290 await startRepl ( {
285291 logging : {
292+ printOptions : options . printOptions === true ,
286293 logStyle : options . prettyLog
287294 ? LogStyle . PRETTY
288295 : ( ( options . logStyle as LogStyle | undefined ) ?? LogStyle . RAW ) ,
0 commit comments