fix: add a new internal printer #25

Manually merged
dananglin merged 1 commit from the-internal-printer into main 2024-06-17 19:12:06 +01:00
Owner

Add a new internal printer package for printing resources to the screen or pager.

The new printer type stores information such as the colour theme, the pager to intergrate with (if applicable), whether ANSI colour output is disabled, etc. This saves us the trouble of passing an increasing number of parameters to an increasing number of Display methods throughout the code base.

The internal printer package replaces the old Displayer interface, the Display methods in the model package, and the format functions in the utilities package. The format functions have migrated to the printer package.

Also, the existing indentation used when displaying resources such as statuses and the instance is removed.
The version info now also supports colour output.

Add a new internal printer package for printing resources to the screen or pager. The new printer type stores information such as the colour theme, the pager to intergrate with (if applicable), whether ANSI colour output is disabled, etc. This saves us the trouble of passing an increasing number of parameters to an increasing number of `Display` methods throughout the code base. The internal printer package replaces the old `Displayer` interface, the `Display` methods in the model package, and the format functions in the utilities package. The format functions have migrated to the printer package. Also, the existing indentation used when displaying resources such as statuses and the instance is removed. The version info now also supports colour output.
dananglin added 6 commits 2024-06-17 03:01:49 +01:00
Author
Owner

Add a top level flag for max terminal width and add a min width set to 40.

Add a top level flag for max terminal width and add a min width set to 40.
Author
Owner
+	a.printer.PrintSuccess("Successfully added a " + a.resourceType + " to the status.\n")

Remove new line char.

``` + a.printer.PrintSuccess("Successfully added a " + a.resourceType + " to the status.\n") ``` Remove new line char.
Author
Owner

Don't forget to check REUSE compliance with reuse lint.

Don't forget to check REUSE compliance with reuse lint.
dananglin changed title from fix: add a new internal printer to WIP: fix: add a new internal printer 2024-06-17 03:18:38 +01:00
Author
Owner

How are we dealing with errors with the new printer?

How are we dealing with errors with the new printer?
dananglin added 2 commits 2024-06-17 10:03:36 +01:00
dananglin added 2 commits 2024-06-17 11:05:07 +01:00
dananglin reviewed 2024-06-17 11:44:50 +01:00
@ -0,0 +133,4 @@
builder.WriteString("\n")
printToStdout(builder.String())
Author
Owner

Should be p.print()

Should be p.print()
dananglin marked this conversation as resolved
dananglin reviewed 2024-06-17 11:46:00 +01:00
@ -0,0 +48,4 @@
builder.WriteString("\n\n")
printToStdout(builder.String())
Author
Owner

Should be p.print()

Should be p.print()
dananglin marked this conversation as resolved
dananglin added 1 commit 2024-06-17 18:52:02 +01:00
dananglin force-pushed the-internal-printer from 07c3b31ce1 to ccdd8b6530 2024-06-17 19:09:38 +01:00 Compare
dananglin changed title from WIP: fix: add a new internal printer to fix: add a new internal printer 2024-06-17 19:11:30 +01:00
dananglin manually merged commit ccdd8b6530 into main 2024-06-17 19:12:06 +01:00
dananglin added this to the v0.1.0 milestone 2024-06-17 19:25:16 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: apollo/enbas#25
No description provided.