From c60eaca3894d0001cc0113fb65815c7b9292cc54 Mon Sep 17 00:00:00 2001
From: MASES Public Developers Team
<94312179+masesdevelopers@users.noreply.github.com>
Date: Mon, 29 Jan 2024 17:34:36 +0100
Subject: [PATCH] Added protection, version upgrade and copyright change (#49)
---
LICENSE | 2 +-
src/documentation/docfx.json | 2 +-
src/net/CLIParser/ArgumentMetadata.cs | 9 ++++++---
src/net/CLIParser/CLIParser.cs | 2 +-
src/net/CLIParser/CLIParser.csproj | 4 ++--
src/net/CLIParser/InternalConst.cs | 2 +-
tests/CLIParserTest/Program.cs | 2 +-
7 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/LICENSE b/LICENSE
index f10bf54..7ffec61 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2023 MASES s.r.l.
+Copyright (c) 2024 MASES s.r.l.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/src/documentation/docfx.json b/src/documentation/docfx.json
index c16902f..05fa0b0 100644
--- a/src/documentation/docfx.json
+++ b/src/documentation/docfx.json
@@ -56,7 +56,7 @@
"_appLogoPath": "images/logo.png",
"_appFaviconPath": "images/favicon.ico",
"_appTitle": "MASES Group website - CLI Parser",
- "_appFooter": "
Copyright © 2023 MASES s.r.l.. | Via San Cesidio 16 - San Valentino in A.C. - PE | P.I. 01932310681
",
+ "_appFooter": "Copyright © 2024 MASES s.r.l.. | Via San Cesidio 16 - San Valentino in A.C. - PE | P.I. 01932310681
",
"_gitContribute": {
}
diff --git a/src/net/CLIParser/ArgumentMetadata.cs b/src/net/CLIParser/ArgumentMetadata.cs
index 809ee87..b3156fe 100644
--- a/src/net/CLIParser/ArgumentMetadata.cs
+++ b/src/net/CLIParser/ArgumentMetadata.cs
@@ -1,7 +1,7 @@
/*
* MIT License
*
- * Copyright (c) 2023 MASES s.r.l.
+ * Copyright (c) 2024 MASES s.r.l.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -469,6 +469,7 @@ string IArgumentMetadataHelper.Parameter()
string IArgumentMetadataHelper.DescriptionBuilder(int width)
{
+ if (width <= 0) width = 80; // set a new default since received one is not Parser.HelpInfo is not correct
Helper.Check();
string description = Helper.Parameter();
description = description.PadRight(Helper.Parser.Settings.DefaultDescriptionPadding, ' ');
@@ -536,8 +537,10 @@ string IArgumentMetadataHelper.DescriptionBuilder(int width)
StringBuilder builder = new StringBuilder();
while (trimming.Length > width)
{
- builder.AppendLine(trimming.Substring(0, width - 2) + "-");
- trimming = string.Empty.PadRight(Helper.Parser.Settings.DefaultDescriptionPadding + 2, ' ') + trimming.Remove(0, width - 2);
+ int cuttingPoint = width - 2;
+ if (cuttingPoint < 0) cuttingPoint = 0;
+ builder.AppendLine(trimming.Substring(0, cuttingPoint) + "-");
+ trimming = string.Empty.PadRight(Helper.Parser.Settings.DefaultDescriptionPadding + 2, ' ') + trimming.Remove(0, cuttingPoint);
}
builder.AppendLine(trimming);
diff --git a/src/net/CLIParser/CLIParser.cs b/src/net/CLIParser/CLIParser.cs
index a966c13..4acf294 100644
--- a/src/net/CLIParser/CLIParser.cs
+++ b/src/net/CLIParser/CLIParser.cs
@@ -1,7 +1,7 @@
/*
* MIT License
*
- * Copyright (c) 2023 MASES s.r.l.
+ * Copyright (c) 2024 MASES s.r.l.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/src/net/CLIParser/CLIParser.csproj b/src/net/CLIParser/CLIParser.csproj
index 60fa47c..56ca5a6 100644
--- a/src/net/CLIParser/CLIParser.csproj
+++ b/src/net/CLIParser/CLIParser.csproj
@@ -4,11 +4,11 @@
MASES.CLIParser
CLIParser - a parser for command line interface
CLIParser - a parser for command line interface
- Copyright © MASES s.r.l. 2023
+ Copyright © MASES s.r.l. 2024
MASES s.r.l.
MASES s.r.l.
MASES s.r.l.
- 3.2.0.0
+ 3.2.1.0
CLIParser
true
netstandard2.0
diff --git a/src/net/CLIParser/InternalConst.cs b/src/net/CLIParser/InternalConst.cs
index 6fb1bd3..679402e 100644
--- a/src/net/CLIParser/InternalConst.cs
+++ b/src/net/CLIParser/InternalConst.cs
@@ -1,7 +1,7 @@
/*
* MIT License
*
- * Copyright (c) 2023 MASES s.r.l.
+ * Copyright (c) 2024 MASES s.r.l.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/tests/CLIParserTest/Program.cs b/tests/CLIParserTest/Program.cs
index d102943..cd20b7c 100644
--- a/tests/CLIParserTest/Program.cs
+++ b/tests/CLIParserTest/Program.cs
@@ -1,7 +1,7 @@
/*
* MIT License
*
- * Copyright (c) 2023 MASES s.r.l.
+ * Copyright (c) 2024 MASES s.r.l.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal