]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
zsh-completion: generate completion for systemd-run from systemd-analyze
authorEisuke Kawashima <e-kwsm@users.noreply.github.com>
Wed, 28 May 2025 10:25:17 +0000 (19:25 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 10 Jul 2025 09:39:06 +0000 (11:39 +0200)
continuation of #37641

shell-completion/zsh/_systemd-run

index 20b858957bd93fe77f1b570a190cefb3d42f6303..1e24ff8e9f0a7e6b6ce277e330f1d26c42050274 100644 (file)
@@ -31,225 +31,9 @@ __systemctl() {
 
 (( $+functions[_systemd-run_properties] )) ||
     _systemd-run_properties() {
-        local -a _properties=(
-            # man/systemd.exec.xml
-            ExecSearchPath=
-            WorkingDirectory=
-            RootDirectory=
-            RootImage=
-            RootImageOptions=
-            RootEphemeral=
-            RootHash=
-            RootHashSignature=
-            RootVerity=
-            RootImagePolicy=
-            MountImagePolicy=
-            ExtensionImagePolicy=
-            MountAPIVFS=
-            BindLogSockets=
-            ProtectProc=
-            ProcSubset=
-            BindPaths=
-            BindReadOnlyPaths=
-            MountImages=
-            ExtensionImages=
-            ExtensionDirectories=
-            User=
-            Group=
-            DynamicUser=
-            SupplementaryGroups=
-            SetLoginEnvironment=
-            PAMName=
-            CapabilityBoundingSet=
-            AmbientCapabilities=
-            NoNewPrivileges=
-            SecureBits=
-            SELinuxContext=
-            AppArmorProfile=
-            SmackProcessLabel=
-            LimitCPU=
-            LimitFSIZE=
-            LimitDATA=
-            LimitSTACK=
-            LimitCORE=
-            LimitRSS=
-            LimitNOFILE=
-            LimitAS=
-            LimitNPROC=
-            LimitMEMLOCK=
-            LimitLOCKS=
-            LimitSIGPENDING=
-            LimitMSGQUEUE=
-            LimitNICE=
-            LimitRTPRIO=
-            LimitRTTIME=
-            UMask=
-            CoredumpFilter=
-            KeyringMode=
-            OOMScoreAdjust=
-            TimerSlackNSec=
-            Personality=
-            IgnoreSIGPIPE=
-            Nice=
-            CPUSchedulingPolicy=
-            CPUSchedulingPriority=
-            CPUSchedulingResetOnFork=
-            CPUAffinity=
-            NUMAPolicy=
-            NUMAMask=
-            IOSchedulingClass=
-            IOSchedulingPriority=
-            ProtectSystem=
-            ProtectHome=
-            RuntimeDirectory=
-            StateDirectory=
-            CacheDirectory=
-            LogsDirectory=
-            ConfigurationDirectory=
-            RuntimeDirectoryMode=
-            StateDirectoryMode=
-            CacheDirectoryMode=
-            LogsDirectoryMode=
-            ConfigurationDirectoryMode=
-            RuntimeDirectoryPreserve=
-            TimeoutCleanSec=
-            ReadWritePaths=
-            ReadOnlyPaths=
-            InaccessiblePaths=
-            ExecPaths=
-            NoExecPaths=
-            TemporaryFileSystem=
-            PrivateTmp=
-            PrivateDevices=
-            PrivateNetwork=
-            NetworkNamespacePath=
-            PrivateIPC=
-            IPCNamespacePath=
-            MemoryKSM=
-            PrivatePIDs=
-            PrivateUsers=
-            ProtectHostname=
-            ProtectClock=
-            ProtectKernelTunables=
-            ProtectKernelModules=
-            ProtectKernelLogs=
-            ProtectControlGroups=
-            RestrictAddressFamilies=
-            RestrictFileSystems=
-            RestrictNamespaces=
-            DelegateNamespaces=
-            LockPersonality=
-            MemoryDenyWriteExecute=
-            RestrictRealtime=
-            RestrictSUIDSGID=
-            RemoveIPC=
-            PrivateMounts=
-            MountFlags=
-            SystemCallFilter=
-            SystemCallErrorNumber=
-            SystemCallArchitectures=
-            SystemCallLog=
-            Environment=
-            EnvironmentFile=
-            PassEnvironment=
-            UnsetEnvironment=
-            StandardInput=
-            StandardOutput=
-            StandardError=
-            StandardInputText=
-            StandardInputData=
-            LogLevelMax=
-            LogExtraFields=
-            LogRateLimitIntervalSec=
-            LogRateLimitBurst=
-            LogFilterPatterns=
-            LogNamespace=
-            SyslogIdentifier=
-            SyslogFacility=
-            SyslogLevel=
-            SyslogLevelPrefix=
-            TTYPath=
-            TTYReset=
-            TTYVHangup=
-            TTYColumns=
-            TTYRows=
-            TTYVTDisallocate=
-            LoadCredential=
-            LoadCredentialEncrypted=
-            ImportCredential=
-            SetCredential=
-            SetCredentialEncrypted=
-            UtmpIdentifier=
-            UtmpMode=
-
-            # man/systemd.kill.xml
-            KillMode=
-            KillSignal=
-            RestartKillSignal=
-            SendSIGHUP=
-            SendSIGKILL=
-            FinalKillSignal=
-            WatchdogSignal=
-
-            # man/systemd.resource-control.xml
-            CPUWeight=
-            StartupCPUWeight=
-            CPUQuota=
-            CPUQuotaPeriodSec=
-            AllowedCPUs=
-            StartupAllowedCPUs=
-            MemoryAccounting=
-            MemoryMin=
-            MemoryLow=
-            StartupMemoryLow=
-            DefaultStartupMemoryLow=
-            MemoryHigh=
-            StartupMemoryHigh=
-            MemoryMax=
-            StartupMemoryMax=
-            MemorySwapMax=
-            StartupMemorySwapMax=
-            MemoryZSwapMax=
-            StartupMemoryZSwapMax=
-            MemoryZSwapWriteback=
-            AllowedMemoryNodes=
-            StartupAllowedMemoryNodes=
-            TasksAccounting=
-            TasksMax=
-            IOAccounting=
-            IOWeight=
-            StartupIOWeight=
-            IODeviceWeight=
-            IOReadBandwidthMax=
-            IOWriteBandwidthMax=
-            IOReadIOPSMax=
-            IOWriteIOPSMax=
-            IODeviceLatencyTargetSec=
-            IPAccounting=
-            IPAddressAllow=
-            IPAddressDeny=
-            SocketBindAllow=
-            SocketBindDeny=
-            RestrictNetworkInterfaces=
-            NFTSet=
-            IPIngressFilterPath=
-            IPEgressFilterPath=
-            BPFProgram=
-            DeviceAllow=
-            DevicePolicy=
-            Slice=
-            Delegate=
-            DelegateSubgroup=
-            DisableControllers=
-            ManagedOOMSwap=
-            ManagedOOMMemoryPressure=
-            ManagedOOMMemoryPressureLimit=
-            ManagedOOMMemoryPressureDurationSec=
-            ManagedOOMPreference=
-            MemoryPressureWatch=
-            MemoryPressureThresholdSec=
-            CoredumpReceive=
-        )
+        local -a _properties
+        _properties=($( systemd-analyze transient-settings scope service 2>/dev/null |
+            while read -r p; do [ -z "$p" ] || echo "$p="; done ))
         _values 'NAME=VALUE' "${_properties[@]}"
     }