Skip to content

Commit

Permalink
Moved ExitCode from ZeroInstall.Publish to ZeroInstall.Publish.Cli
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianeicher committed Mar 29, 2024
1 parent 4079b46 commit 9004365
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
49 changes: 49 additions & 0 deletions src/ExitCode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Copyright Bastian Eicher et al.
// Licensed under the GNU Lesser Public License

using System.Net;
using ZeroInstall.Model;
using ZeroInstall.Store.Implementations;

namespace ZeroInstall.Publish.Cli;

/// <summary>
/// An exit code is returned to the original caller after the application terminates, to indicate success or the reason for failure.
/// </summary>
public enum ExitCode
{
/// <summary>The operation completed without any problems.</summary>
OK = 0,

/// <summary>There was a network problem. This may be intermittent and resolve itself e.g. when a Wi-Fi connection is restored.</summary>
/// <seealso cref="WebException"/>
WebError = 10,

/// <summary>You have insufficient access rights. This can potentially be fixed by running the command as an Administrator/root. It may also indicate misconfigured file permissions.</summary>
/// <seealso cref="UnauthorizedAccessException"/>
AccessDenied = 11,

/// <summary>There was an IO problem. This encompasses issues such as missing files or insufficient disk space.</summary>
/// <seealso cref="IOException"/>
IOError = 12,

/// <summary>A data file could not be parsed. This encompasses issues such as damaged configuration files or malformed XML documents (e.g. feeds).</summary>
/// <seealso cref="InvalidDataException"/>
InvalidData = 25,

/// <summary>The <see cref="ManifestDigest"/> of an implementation does not match the expected value. This could be caused by a damaged download or an incorrect feed.</summary>
/// <seealso cref="DigestMismatchException"/>
DigestMismatch = 26,

/// <summary>The operation could not be completed because a feature that is not (yet) supported was requested. Upgrading to a newer version may resolve this issue.</summary>
/// <seealso cref="NotSupportedException"/>
NotSupported = 50,

/// <summary>The command-line arguments passed to the application were invalid.</summary>
/// <seealso cref="FormatException"/>
InvalidArguments = 99,

/// <summary>The user canceled the task.</summary>
/// <seealso cref="OperationCanceledException"/>
UserCanceled = 100
}
1 change: 0 additions & 1 deletion src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using NanoByte.Common.Net;
using NanoByte.Common.Tasks;
using NDesk.Options;
using ZeroInstall.Publish;
using ZeroInstall.Publish.Cli;
using ZeroInstall.Store.Implementations;
using ZeroInstall.Store.Trust;
Expand Down
2 changes: 2 additions & 0 deletions src/ZeroInstall.Publish.Cli.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
<s:String x:Key="/Default/CodeStyle/FileHeader/FileHeaderText/@EntryValue">Copyright Bastian Eicher et al.&#xD;
Licensed under the GNU Lesser Public License</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ID/@EntryIndexedValue">ID</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IO/@EntryIndexedValue">IO</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=OK/@EntryIndexedValue">OK</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticReadonly/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /&gt;</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002ECodeCleanup_002EFileHeader_002EFileHeaderSettingsMigrate/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Eicher/@EntryIndexedValue">True</s:Boolean>
Expand Down

0 comments on commit 9004365

Please sign in to comment.