@@ -88,16 +88,17 @@ describe('embedded CLI output ownership', () => {
8888 expect ( invalid . stderr ) . toContain ( 'missing required argument' )
8989 } )
9090
91- it ( 'answers a guessed flag with the command flags and an id that opens with a dash with the escape' , async ( ) => {
91+ it ( 'answers a guessed flag with the command flags, and an id that opens with a dash with the escape' , async ( ) => {
9292 const transport = async ( ) => {
9393 throw new Error ( 'a parse error must not reach the API' )
9494 }
95- const [ guessed , dashedId ] = await Promise . all ( [
95+ const [ guessed , dashedId , noArguments ] = await Promise . all ( [
9696 runEmbeddedCli ( [ 'tables' , 'rows' , 'batch-delete' , 'tbl_1' , '--row-ids' , 'row_1' , '--yes' ] , {
9797 ...identity ,
9898 transport,
9999 } ) ,
100100 runEmbeddedCli ( [ 'audit-logs' , 'get' , '-X9abc' ] , { ...identity , transport } ) ,
101+ runEmbeddedCli ( [ 'logs' , 'list' , '-X9abc' ] , { ...identity , transport } ) ,
101102 ] )
102103 expect ( guessed . exitCode ) . toBe ( 1 )
103104 expect ( guessed . stderr ) . toContain ( "unknown option '--row-ids'" )
@@ -106,5 +107,9 @@ describe('embedded CLI output ownership', () => {
106107 expect ( dashedId . exitCode ) . toBe ( 1 )
107108 expect ( dashedId . stderr ) . toContain ( 'Example: sim audit-logs get -- -X9abc' )
108109 expect ( dashedId . stderr ) . not . toContain ( 'Options for' )
110+ // With no positional to escape into, an id-shaped token is just an unknown option.
111+ expect ( noArguments . exitCode ) . toBe ( 1 )
112+ expect ( noArguments . stderr ) . toContain ( 'Options for sim logs list:' )
113+ expect ( noArguments . stderr ) . not . toContain ( 'Example:' )
109114 } )
110115} )
0 commit comments