From 9004365d070b2aebb7a220f82a71336c79531580 Mon Sep 17 00:00:00 2001 From: Bastian Eicher Date: Fri, 29 Mar 2024 16:45:37 +0100 Subject: [PATCH] Moved ExitCode from ZeroInstall.Publish to ZeroInstall.Publish.Cli --- src/ExitCode.cs | 49 +++++++++++++++++++++ src/Program.cs | 1 - src/ZeroInstall.Publish.Cli.sln.DotSettings | 2 + 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 src/ExitCode.cs diff --git a/src/ExitCode.cs b/src/ExitCode.cs new file mode 100644 index 0000000..36a34c0 --- /dev/null +++ b/src/ExitCode.cs @@ -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; + +/// +/// An exit code is returned to the original caller after the application terminates, to indicate success or the reason for failure. +/// +public enum ExitCode +{ + /// The operation completed without any problems. + OK = 0, + + /// There was a network problem. This may be intermittent and resolve itself e.g. when a Wi-Fi connection is restored. + /// + WebError = 10, + + /// 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. + /// + AccessDenied = 11, + + /// There was an IO problem. This encompasses issues such as missing files or insufficient disk space. + /// + IOError = 12, + + /// A data file could not be parsed. This encompasses issues such as damaged configuration files or malformed XML documents (e.g. feeds). + /// + InvalidData = 25, + + /// The of an implementation does not match the expected value. This could be caused by a damaged download or an incorrect feed. + /// + DigestMismatch = 26, + + /// 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. + /// + NotSupported = 50, + + /// The command-line arguments passed to the application were invalid. + /// + InvalidArguments = 99, + + /// The user canceled the task. + /// + UserCanceled = 100 +} diff --git a/src/Program.cs b/src/Program.cs index fe9bd31..4063610 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -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; diff --git a/src/ZeroInstall.Publish.Cli.sln.DotSettings b/src/ZeroInstall.Publish.Cli.sln.DotSettings index 05a554c..f3492e2 100644 --- a/src/ZeroInstall.Publish.Cli.sln.DotSettings +++ b/src/ZeroInstall.Publish.Cli.sln.DotSettings @@ -17,6 +17,8 @@ Copyright Bastian Eicher et al. Licensed under the GNU Lesser Public License ID + IO + OK <Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /> True True