public IEnumerable <string> GetCodeItems(OptionPreference preferLongNames = OptionPreference.Short) { // -z, --gzip: Filter the archive through gzip(1). if ((Flags & TarFlags.Gzip) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--gzip" : "-z"); } // -Z, --compress: Filter the archive through compress(1). if ((Flags & TarFlags.Compress) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--compress" : "-Z"); } // -v: Verbose if ((Flags & TarFlags.Verbose) != 0) { yield return("-v"); } // -f =tar-archive: Archive if (!string.IsNullOrEmpty(ArchiveFileName)) { yield return("-f"); yield return(ArchiveFileName.ShellQuote()); } }
public IEnumerable <string> GetCodeItems(OptionPreference preferLongNames = OptionPreference.Short) { // --resolve-image-digests: Pin image tags to digests. if ((Flags & DockerComposeConfigFlags.ResolveImageDigests) != 0) { yield return("--resolve-image-digests"); } // --no-interpolate: Don't interpolate environment variables. if ((Flags & DockerComposeConfigFlags.NoInterpolate) != 0) { yield return("--no-interpolate"); } // -q, --quiet: Only validate the configuration, don't print anything. if ((Flags & DockerComposeConfigFlags.Quiet) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--quiet" : "-q"); } // --services: Print the service names, one per line. if ((Flags & DockerComposeConfigFlags.Services) != 0) { yield return("--services"); } // --volumes: Print the volume names, one per line. if ((Flags & DockerComposeConfigFlags.Volumes) != 0) { yield return("--volumes"); } // --hash =servicesOrWild: Print the service config hash, one per line. Set "service1,service2" for a list of specified services or use the wildcard symbol to display all services. if (!string.IsNullOrEmpty(Hash)) { yield return("--hash"); yield return(Hash.ShellQuote()); } }
public IEnumerable <string> GetCodeItems(OptionPreference preferLongNames = OptionPreference.Short) { // -o: Overwrite existing files without prompting. if ((Flags & UnzipFlags.Overwrite) != 0) { yield return("-o"); } // -x exclude: An optional list of archive members to be excluded from processing. if (!(X is null) && X.Count > 0) { yield return("-x"); foreach (var xItem in X) { yield return(xItem.ShellQuote()); } } // -d =output-directory: An optional directory to which to extract files. if (!string.IsNullOrEmpty(OutputDirectory)) { yield return("-d"); yield return(OutputDirectory.ShellQuote()); } }
public static IEnumerable <string> OptionsToString(this UnzipFlags value, OptionPreference preferLongNames = OptionPreference.Short) { // generator : SingleTaskEnumsGenerator // -o: Overwrite existing files without prompting. if ((value & UnzipFlags.Overwrite) != 0) { yield return("-o"); } }
public IEnumerable <string> GetCodeItems(OptionPreference preferLongNames = OptionPreference.Short) { // --protocol =proto: tcp or udp [default: tcp] if (!(Protocol is null)) { yield return("--protocol"); yield return(Protocol.Value.ToLinuxValue()); } // --index =index: index of the container if there are multiple instances of a service [default: 1] if (!(Index is null)) { yield return("--index"); yield return(Index.Value.ToString(CultureInfo.InvariantCulture)); } }
public static IEnumerable <string> OptionsToString(this TarFlags value, OptionPreference preferLongNames = OptionPreference.Short) { // generator : SingleTaskEnumsGenerator CheckConflicts(value); // -z, --gzip: Filter the archive through gzip(1). if ((value & TarFlags.Gzip) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--gzip" : "-z"); } // -Z, --compress: Filter the archive through compress(1). if ((value & TarFlags.Compress) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--compress" : "-Z"); } // -v: Verbose if ((value & TarFlags.Verbose) != 0) { yield return("-v"); } }
public static IEnumerable <string> OptionsToString(this UserAddFlags value, OptionPreference preferLongNames = OptionPreference.Short) { // generator : SingleTaskEnumsGenerator CheckConflicts(value); // -l, --no-log-init: Do not add the user to the lastlog and faillog databases. if ((value & UserAddFlags.NoLogInit) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--no-log-init" : "-l"); } // -m, --create-home: Create the user's home directory if it does not exist. if ((value & UserAddFlags.CreateHome) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--create-home" : "-m"); } // -M: Do not create the user's home directory, even if the system wide setting from /etc/login.defs (CREATE_HOME) is set to yes. if ((value & UserAddFlags.DoNotCreateHomeDirectory) != 0) { yield return("-M"); } // -N, --no-user-group: Do not create a group with the same name as the user, but add the user to the group specified by the -g option or by the GROUP variable in /etc/default/useradd. if ((value & UserAddFlags.NoUserGroup) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--no-user-group" : "-N"); } // -o, --non-unique: Allow the creation of a user account with a duplicate (non-unique) UID. if ((value & UserAddFlags.NonUnique) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--non-unique" : "-o"); } // -r, --system: Create a system account. if ((value & UserAddFlags.System) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--system" : "-r"); } // -U, --user-group: Create a group with the same name as the user, and add the user to this group. The default behavior (if the -g, -N, and -U options are not specified) is defined by the USERGROUPS_ENAB variable in /etc/login.defs. if ((value & UserAddFlags.UserGroup) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--user-group" : "-U"); } }
public IEnumerable <string> GetCodeItems(OptionPreference preferLongNames = OptionPreference.Short) { // --compress: Compress the build context using gzip. if ((Flags & DockerComposeBuildFlags.Compress) != 0) { yield return("--compress"); } // --force-rm: Always remove intermediate containers. if ((Flags & DockerComposeBuildFlags.ForceRm) != 0) { yield return("--force-rm"); } // --no-cache: Do not use cache when building the image. if ((Flags & DockerComposeBuildFlags.NoCache) != 0) { yield return("--no-cache"); } // --no-rm: Do not remove intermediate containers after a successful build. if ((Flags & DockerComposeBuildFlags.NoRm) != 0) { yield return("--no-rm"); } // --parallel: Build images in parallel. if ((Flags & DockerComposeBuildFlags.Parallel) != 0) { yield return("--parallel"); } // --pull: Always attempt to pull a newer version of the image. if ((Flags & DockerComposeBuildFlags.Pull) != 0) { yield return("--pull"); } // -q, --quiet: Don't print anything to `STDOUT`. if ((Flags & DockerComposeBuildFlags.Quiet) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--quiet" : "-q"); } }
public static IEnumerable <string> OptionsToString(this DockerComposeUpFlags value, OptionPreference preferLongNames = OptionPreference.Short) { // generator : SingleTaskEnumsGenerator CheckConflicts(value); // -d, --detach: Detached mode: Run containers in the background, print new container names. Incompatible with --abort-on-container-exit. if ((value & DockerComposeUpFlags.Detach) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--detach" : "-d"); } // --no-color: Produce monochrome output. if ((value & DockerComposeUpFlags.NoColor) != 0) { yield return("--no-color"); } // --quiet-pull: Pull without printing progress information if ((value & DockerComposeUpFlags.QuietPull) != 0) { yield return("--quiet-pull"); } // --no-deps: Don't start linked services. if ((value & DockerComposeUpFlags.NoDeps) != 0) { yield return("--no-deps"); } // --force-recreate: Recreate containers even if their configuration and image haven't changed. if ((value & DockerComposeUpFlags.ForceRecreate) != 0) { yield return("--force-recreate"); } // --always-recreate-deps: Recreate dependent containers. Incompatible with --no-recreate. if ((value & DockerComposeUpFlags.AlwaysRecreateDeps) != 0) { yield return("--always-recreate-deps"); } // --no-recreate: If containers already exist, don't recreate them. Incompatible with --force-recreate and --renew-anon-volumes. if ((value & DockerComposeUpFlags.NoRecreate) != 0) { yield return("--no-recreate"); } // --no-build: Don't build an image, even if it's missing. if ((value & DockerComposeUpFlags.NoBuild) != 0) { yield return("--no-build"); } // --no-start: Don't start the services after creating them. if ((value & DockerComposeUpFlags.NoStart) != 0) { yield return("--no-start"); } // --build: Build images before starting containers. if ((value & DockerComposeUpFlags.Build) != 0) { yield return("--build"); } // --abort-on-container-exit: Stops all containers if any container was stopped. Incompatible with --detach. if ((value & DockerComposeUpFlags.AbortOnContainerExit) != 0) { yield return("--abort-on-container-exit"); } // --attach-dependencies: Attach to dependent containers. if ((value & DockerComposeUpFlags.AttachDependencies) != 0) { yield return("--attach-dependencies"); } // -V, --renew-anon-volumes: Recreate anonymous volumes instead of retrieving data from the previous containers. if ((value & DockerComposeUpFlags.RenewAnonVolumes) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--renew-anon-volumes" : "-V"); } // --remove-orphans: Remove containers for services not defined in the Compose file. if ((value & DockerComposeUpFlags.RemoveOrphans) != 0) { yield return("--remove-orphans"); } }
public IEnumerable <string> GetCodeItems(OptionPreference preferLongNames = OptionPreference.Short) { // -d, --detach: Detached mode: Run containers in the background, print new container names. Incompatible with --abort-on-container-exit. if ((Flags & DockerComposeUpFlags.Detach) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--detach" : "-d"); } // --no-color: Produce monochrome output. if ((Flags & DockerComposeUpFlags.NoColor) != 0) { yield return("--no-color"); } // --quiet-pull: Pull without printing progress information if ((Flags & DockerComposeUpFlags.QuietPull) != 0) { yield return("--quiet-pull"); } // --no-deps: Don't start linked services. if ((Flags & DockerComposeUpFlags.NoDeps) != 0) { yield return("--no-deps"); } // --force-recreate: Recreate containers even if their configuration and image haven't changed. if ((Flags & DockerComposeUpFlags.ForceRecreate) != 0) { yield return("--force-recreate"); } // --always-recreate-deps: Recreate dependent containers. Incompatible with --no-recreate. if ((Flags & DockerComposeUpFlags.AlwaysRecreateDeps) != 0) { yield return("--always-recreate-deps"); } // --no-recreate: If containers already exist, don't recreate them. Incompatible with --force-recreate and --renew-anon-volumes. if ((Flags & DockerComposeUpFlags.NoRecreate) != 0) { yield return("--no-recreate"); } // --no-build: Don't build an image, even if it's missing. if ((Flags & DockerComposeUpFlags.NoBuild) != 0) { yield return("--no-build"); } // --no-start: Don't start the services after creating them. if ((Flags & DockerComposeUpFlags.NoStart) != 0) { yield return("--no-start"); } // --build: Build images before starting containers. if ((Flags & DockerComposeUpFlags.Build) != 0) { yield return("--build"); } // --abort-on-container-exit: Stops all containers if any container was stopped. Incompatible with --detach. if ((Flags & DockerComposeUpFlags.AbortOnContainerExit) != 0) { yield return("--abort-on-container-exit"); } // --attach-dependencies: Attach to dependent containers. if ((Flags & DockerComposeUpFlags.AttachDependencies) != 0) { yield return("--attach-dependencies"); } // -V, --renew-anon-volumes: Recreate anonymous volumes instead of retrieving data from the previous containers. if ((Flags & DockerComposeUpFlags.RenewAnonVolumes) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--renew-anon-volumes" : "-V"); } // --remove-orphans: Remove containers for services not defined in the Compose file. if ((Flags & DockerComposeUpFlags.RemoveOrphans) != 0) { yield return("--remove-orphans"); } // -t, --timeout =TIMEOUT: Use this timeout in seconds for container shutdown when attached or when containers are already running. (default: 10) if (!(Timeout is null)) { yield return("--timeout"); yield return(Timeout.Value.ToString(CultureInfo.InvariantCulture)); } // --exit-code-from =SERVICE: Return the exit code of the selected service container. Implies --abort-on-container-exit. if (!string.IsNullOrEmpty(ExitCodeFrom)) { yield return("--exit-code-from"); yield return(ExitCodeFrom.ShellQuote()); } // --scale SERVICE=NUM: Scale SERVICE to NUM instances. Overrides the `scale` setting in the Compose file if present. foreach (var pair in Scale) { yield return("--scale"); var value = pair.Value.ToString(CultureInfo.InvariantCulture); yield return($"{pair.Key}={value}"); } }
public IEnumerable <string> GetCodeItems(OptionPreference preferLongNames = OptionPreference.Short) { // --verbose: Show more output if ((Flags & DockerComposeCommonFlags.Verbose) != 0) { yield return("--verbose"); } // --no-ansi: Do not print ANSI control characters if ((Flags & DockerComposeCommonFlags.NoAnsi) != 0) { yield return("--no-ansi"); } // -v, --version: Print version and exit if ((Flags & DockerComposeCommonFlags.Version) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--version" : "-v"); } // --tls: Use TLS; implied by --tlsverify if ((Flags & DockerComposeCommonFlags.Tls) != 0) { yield return("--tls"); } // --tlsverify: Use TLS and verify the remote if ((Flags & DockerComposeCommonFlags.Tlsverify) != 0) { yield return("--tlsverify"); } // --skip-hostname-check: Don't check the daemon's hostname against the name specified in the client certificate if ((Flags & DockerComposeCommonFlags.SkipHostnameCheck) != 0) { yield return("--skip-hostname-check"); } // --compatibility: If set, Compose will attempt to convert deploy keys in v3 files to their non-Swarm equivalent if ((Flags & DockerComposeCommonFlags.Compatibility) != 0) { yield return("--compatibility"); } // -f, --file =FILE: Specify an alternate compose file (default: docker-compose.yml) if (!string.IsNullOrEmpty(File)) { yield return("--file"); yield return(File.ShellQuote()); } // -p, --project-name =NAME: Specify an alternate project name (default: directory name) if (!string.IsNullOrEmpty(ProjectName)) { yield return("--project-name"); yield return(ProjectName.ShellQuote()); } // --log-level =LEVEL: Set log level (DEBUG, INFO, WARNING, ERROR, CRITICAL) if (!(LogLevel is null)) { yield return("--log-level"); yield return(LogLevel.Value.ToLinuxValue()); } // -H, --host =HOST: Daemon socket to connect to if (!string.IsNullOrEmpty(Host)) { yield return("--host"); yield return(Host.ShellQuote()); } // --tlscacert =CA_PATH: Trust certs signed only by this CA if (!string.IsNullOrEmpty(Tlscacert)) { yield return("--tlscacert"); yield return(Tlscacert.ShellQuote()); } // --tlscert =CLIENT_CERT_PATH: Path to TLS certificate file if (!string.IsNullOrEmpty(Tlscert)) { yield return("--tlscert"); yield return(Tlscert.ShellQuote()); } // --tlskey =TLS_KEY_PATH: Path to TLS key file if (!string.IsNullOrEmpty(Tlskey)) { yield return("--tlskey"); yield return(Tlskey.ShellQuote()); } // --project-directory =PATH: Specify an alternate working directory (default: the path of the Compose file) if (!string.IsNullOrEmpty(ProjectDirectory)) { yield return("--project-directory"); yield return(ProjectDirectory.ShellQuote()); } }
public static IEnumerable <string> OptionsToString(this DockerComposeCommonFlags value, OptionPreference preferLongNames = OptionPreference.Short) { // generator : SingleTaskEnumsGenerator // --verbose: Show more output if ((value & DockerComposeCommonFlags.Verbose) != 0) { yield return("--verbose"); } // --no-ansi: Do not print ANSI control characters if ((value & DockerComposeCommonFlags.NoAnsi) != 0) { yield return("--no-ansi"); } // -v, --version: Print version and exit if ((value & DockerComposeCommonFlags.Version) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--version" : "-v"); } // --tls: Use TLS; implied by --tlsverify if ((value & DockerComposeCommonFlags.Tls) != 0) { yield return("--tls"); } // --tlsverify: Use TLS and verify the remote if ((value & DockerComposeCommonFlags.Tlsverify) != 0) { yield return("--tlsverify"); } // --skip-hostname-check: Don't check the daemon's hostname against the name specified in the client certificate if ((value & DockerComposeCommonFlags.SkipHostnameCheck) != 0) { yield return("--skip-hostname-check"); } // --compatibility: If set, Compose will attempt to convert deploy keys in v3 files to their non-Swarm equivalent if ((value & DockerComposeCommonFlags.Compatibility) != 0) { yield return("--compatibility"); } }
public static IEnumerable <string> OptionsToString(this DockerComposeConfigFlags value, OptionPreference preferLongNames = OptionPreference.Short) { // generator : SingleTaskEnumsGenerator // --resolve-image-digests: Pin image tags to digests. if ((value & DockerComposeConfigFlags.ResolveImageDigests) != 0) { yield return("--resolve-image-digests"); } // --no-interpolate: Don't interpolate environment variables. if ((value & DockerComposeConfigFlags.NoInterpolate) != 0) { yield return("--no-interpolate"); } // -q, --quiet: Only validate the configuration, don't print anything. if ((value & DockerComposeConfigFlags.Quiet) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--quiet" : "-q"); } // --services: Print the service names, one per line. if ((value & DockerComposeConfigFlags.Services) != 0) { yield return("--services"); } // --volumes: Print the volume names, one per line. if ((value & DockerComposeConfigFlags.Volumes) != 0) { yield return("--volumes"); } }
public IEnumerable <string> GetCodeItems(OptionPreference preferLongNames = OptionPreference.Short) { // -l, --no-log-init: Do not add the user to the lastlog and faillog databases. if ((Flags & UserAddFlags.NoLogInit) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--no-log-init" : "-l"); } // -m, --create-home: Create the user's home directory if it does not exist. if ((Flags & UserAddFlags.CreateHome) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--create-home" : "-m"); } // -M: Do not create the user's home directory, even if the system wide setting from /etc/login.defs (CREATE_HOME) is set to yes. if ((Flags & UserAddFlags.DoNotCreateHomeDirectory) != 0) { yield return("-M"); } // -N, --no-user-group: Do not create a group with the same name as the user, but add the user to the group specified by the -g option or by the GROUP variable in /etc/default/useradd. if ((Flags & UserAddFlags.NoUserGroup) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--no-user-group" : "-N"); } // -o, --non-unique: Allow the creation of a user account with a duplicate (non-unique) UID. if ((Flags & UserAddFlags.NonUnique) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--non-unique" : "-o"); } // -r, --system: Create a system account. if ((Flags & UserAddFlags.System) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--system" : "-r"); } // -U, --user-group: Create a group with the same name as the user, and add the user to this group. The default behavior (if the -g, -N, and -U options are not specified) is defined by the USERGROUPS_ENAB variable in /etc/login.defs. if ((Flags & UserAddFlags.UserGroup) != 0) { yield return(preferLongNames == OptionPreference.Long ? "--user-group" : "-U"); } // -b, --base-dir =BASE_DIR: BASE_DIR is concatenated with the account name to define the home directory. if (!string.IsNullOrEmpty(BaseDir)) { yield return("--base-dir"); yield return(BaseDir.ShellQuote()); } // -c, --comment =COMMENT: Any text string. if (!string.IsNullOrEmpty(Comment)) { yield return("--comment"); yield return(Comment.ShellQuote()); } // -d, --home =HOME_DIR: The new user will be created using HOME_DIR as the value for the user's login directory. if (!string.IsNullOrEmpty(Home)) { yield return("--home"); yield return(Home.ShellQuote()); } // -g, --gid =GROUP: The group name or number of the user's initial login group. The group name must exist. if (!string.IsNullOrEmpty(Gid)) { yield return("--gid"); yield return(Gid.ShellQuote()); } // -K, --key KEY=VALUE: Overrides /etc/login.defs defaults (UID_MIN, UID_MAX, UMASK, PASS_MAX_DAYS and others) foreach (var pair in Key) { yield return("--key"); var value = pair.Value.ShellQuote(); yield return($"{pair.Key}={value}"); } // -p, --password =PASSWORD: The encrypted password, as returned by crypt(3). The default is to disable the password. if (!string.IsNullOrEmpty(Password)) { yield return("--password"); yield return(Password.ShellQuote()); } }