Skip to content

Commit 7ac2ee6

Browse files
authored
Merge pull request #3 from tip2tail/issue-1-byte-count-alignment
Fix alignment issue #1
2 parents e36378f + 5bca830 commit 7ac2ee6

File tree

5 files changed

+70
-6
lines changed

5 files changed

+70
-6
lines changed

.vscode/launch.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,24 @@
55
"version": "0.2.0",
66
"configurations": [
77
{
8-
"name": ".NET Core Launch (console)",
8+
"name": "Debug Run | Program.cs -s 100 -c 150",
9+
"type": "coreclr",
10+
"request": "launch",
11+
"preLaunchTask": "build",
12+
// If you have changed target frameworks, make sure to update the program path.
13+
"program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/HexPrintFile.dll",
14+
"args": [
15+
"${workspaceFolder}/Program.cs",
16+
"-s 100",
17+
"-c 150"
18+
],
19+
"cwd": "${workspaceFolder}",
20+
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
21+
"console": "internalConsole",
22+
"stopAtEntry": false
23+
},
24+
{
25+
"name": "Debug Run | -help",
926
"type": "coreclr",
1027
"request": "launch",
1128
"preLaunchTask": "build",

CHANGES.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# HexPrintFile Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [1.0.1] - 2020-05-24
11+
12+
### Added
13+
- This changelog document.
14+
15+
### Changed
16+
- Fixed alignment of the byte count headings.
17+
18+
## 1.0.0 - 2020-05-22
19+
20+
### Added
21+
- Initial release
22+
23+
[unreleased]: https://github.com/tip2tail/HexPrintFile/compare/v1.0.1...HEAD
24+
[1.0.1]: https://github.com/tip2tail/HexPrintFile/compare/v1.0.0...v1.0.1

HexPrintFile.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<!-- Deterministic needs to be false for the build date functionality to work -->
99
<Deterministic>false</Deterministic>
10-
<AssemblyVersion>1.0.0</AssemblyVersion>
10+
<AssemblyVersion>1.0.1</AssemblyVersion>
1111

1212
</PropertyGroup>
1313

Program.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ private static bool ExecuteHexPrint(string fileName,
252252
: "Note: Strings are all ZERO INDEXED");
253253
Console.WriteLine("");
254254

255-
OutputHeader(mainImage, zeroImage);
255+
OutputHeader(ref mainImage, zeroImage);
256256

257257
try
258258
{
@@ -316,17 +316,21 @@ private static bool ExecuteHexPrint(string fileName,
316316
return false;
317317
}
318318

319-
OutputHeader(mainImage, zeroImage);
319+
OutputHeader(ref mainImage, zeroImage);
320320
return true;
321321
}
322322

323323
/// <summary>
324324
/// Outputs the header for the HEX print
325325
/// </summary>
326-
/// <param name="mainImage">Main byte range image</param>
326+
/// <param name="mainImage" ref="true">Main byte range image</param>
327327
/// <param name="zeroImage">Zero count byte range image</param>
328-
private static void OutputHeader(string mainImage, string zeroImage)
328+
private static void OutputHeader(ref string mainImage, string zeroImage)
329329
{
330+
// Main heading minimum = 14
331+
if (mainImage.Length < 5) {
332+
mainImage = "00000";
333+
}
330334
var mainLen = ((2 * mainImage.Length) + 4) + 1;
331335
var mainHeading = "ACTUAL BYTES";
332336
while (mainHeading.Length < mainLen) {

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
</p>
3030

3131
<!-- ABOUT THE PROJECT -->
32+
## Changelog
33+
34+
View the changes to this project: [Changelog](./CHANGES.md).
35+
3236
## Screenshot
3337

3438
<img src="screen.png" alt="Screenshot">
@@ -105,7 +109,22 @@ Contributions are what make the open source community such an amazing place to b
105109
4. Push to the Branch (`git push origin feature/AmazingFeature`)
106110
5. Open a Pull Request
107111

112+
## Build Release Version
113+
114+
To build a release version use the following commands.
108115

116+
- Windows
117+
````
118+
dotnet publish -c Release --self-contained -r win-x64 /p:PublishSingleFile=true
119+
````
120+
- Linux
121+
````
122+
dotnet publish -c Release --self-contained -r linux-x64 /p:PublishSingleFile=true
123+
````
124+
- macOS
125+
````
126+
dotnet publish -c Release --self-contained -r osx-x64 /p:PublishSingleFile=true
127+
````
109128

110129
<!-- LICENSE -->
111130
## License

0 commit comments

Comments
 (0)