Skip to content

Commit

Permalink
Fix assistant (#1484)
Browse files Browse the repository at this point in the history
* Fix assistant from merge

* Log `format_tools` variables

* Possible fix to `format_tools`
  • Loading branch information
InAnYan authored Nov 11, 2024
1 parent e33a2b7 commit c055473
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 14 additions & 3 deletions module/core/format_tools/src/format/output_format/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,20 @@ impl TableOutputFormat for Table

write!( c.buf, "{}", cell_prefix )?;

// println!( "icol : {icol} | irow : {irow} | width : {width} | cell_width : {cell_width}" );
let lspaces = ( width - cell_width ) / 2;
let rspaces = ( width - cell_width + 1 ) / 2 + cell_width - slice.len();
println!( "icol : {icol} | irow : {irow} | width : {width} | cell_width : {cell_width} | slice.len() : {}", slice.len() );

let lspaces = if cell_width > width {
0
} else {
( width - cell_width ) / 2
};

let rspaces = if (cell_width > width) || (slice.len() > cell_width) {
0
} else {
( width - cell_width + 1 ) / 2 + cell_width - slice.len()
};

// println!( "icol : {icol} | irow : {irow} | width : {width} | cell_width : {cell_width} | lspaces : {lspaces} | rspaces : {rspaces}" );

if lspaces > 0
Expand Down
2 changes: 1 addition & 1 deletion module/move/assistant/src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use clap::Parser;

use assistant::
{
client,
client::client,
commands::{ Cli, CliCommand, self },
Secret
};
Expand Down

0 comments on commit c055473

Please sign in to comment.