From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id fa8f21c4 for ; Wed, 9 Oct 2019 18:16:36 +0000 (UTC) Received: (qmail 8413 invoked by alias); 9 Oct 2019 18:16:30 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24340 Received: (qmail 21634 invoked by uid 1010); 9 Oct 2019 18:16:30 -0000 X-Qmail-Scanner-Diagnostics: from mail-lf1-f41.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25594. spamassassin: 3.4.2. Clear:RC:0(209.85.167.41):SA:0(-1.9/5.0):. Processed in 3.385239 secs); 09 Oct 2019 18:16:30 -0000 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.167.41 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=w8AVjWZBQ+kwJ1W8mxiQGYP+W5SJo+/ns4YypwurrO4=; b=nWSy+zP6KmHj5oVuUzNjJ4ZUNq+XT36qRKBkyTFC1iHIW+jORpqrF3QEfZY6LMAqUR Mn7Ac31iIHR5SeJIB0IKXbfPbjE9nUzXTTBpfjfozL+nuU913O7JYmC6mygHichSWARI pr8KlmAhnMHrWpD1nKATeVk93hU4xHhfDsB618/U+m28b3kB+W7ZLU6IClY0AoJWhPJD fQeMlSSHDZUVujSVo/U18PppNf7oky5HCjclZ3isXiFheuNOuu0Hte2Ff1yWuuVvr3aH 98W+2XzuOTpUYcWoq0Blu5vrTNi0S9mp1NFbl2S+CszkXROugf0vNyiZYPCp6UTYPvVZ TDZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=w8AVjWZBQ+kwJ1W8mxiQGYP+W5SJo+/ns4YypwurrO4=; b=W5+EzWvrcGZbBHslEoaI98afx0T1BiQE3VKUDogmiHKTdvCt2EdIfwOsBFeXICE/If tnj350aEYYYuubYW8kHrKToFp2Z74MbUL5sIl88rufgA5L6uqmjV2/ttCosVT6I4UEoS +ITp6QeOWLJnfDYBFYniphHZDzOTNy0494z2SGYVkStDRVx5itgEog4uNRw7oUZgiwsD DcraroayZs7M6JFXVhOy705EGI+0xBzH9RPh5on6SdkC+FfU90f8LPnUr1TRQHl+tcdU UYIdB1Wwgzo/TU2Hc74PjQ8XsXFjdAZBvT2uH8CBDamwrK2BTTpIQi6lj6Oj7eMfHoH1 mnxw== X-Gm-Message-State: APjAAAWamTEG9ckZxuc/tXRCvkkkwU/Ewf6tAcuBNSoTNYA8Ydp/KvWu vyEsPLfAFH1/Mkdeih7A8YokfakSacY3pF7Su9A+sQ== X-Google-Smtp-Source: APXvYqzShVHbtfflt4P6KtI+KfC40wCSn+JGBG+zVif2wJNLi1bzbqvfH4hrtEGLzZbEqqfAY7fFrIw6lDDxJfHmwn8= X-Received: by 2002:a19:380b:: with SMTP id f11mr310473lfa.81.1570644951332; Wed, 09 Oct 2019 11:15:51 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Wed, 9 Oct 2019 11:15:39 -0700 Message-ID: Subject: Re: Feature request: a new warning option To: Sebastian Gniazdowski Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" On Tue, Oct 8, 2019 at 9:03 PM Sebastian Gniazdowski wrote: > > The warning would be triggered when: > - a an || would occur after an instruction preceded by &&, > - the instruction wouldn't be an always-true instruction To add to what's already been bandied about: This seems like something better suited for a shell script "lint" type program, rather than something to emit as a run-time warning from the shell itself. There's also the question of when this warning would be emitted; if at execute time, is it really doing anything useful? If at parse time, the parser has to become aware of even more semantics. Creation of global variables and references to unset variables can't really be detected by syntax examination, but all the cases the shell could successfully warn about in this scheme are, I think, resolvable by looking at the individual pipelines. If you want a runtime warning, maybe do something with ${(z)ZSH_DEBUG_CMD} in a TRAPDEBUG function?