From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 4510 invoked from network); 4 Sep 2021 16:43:14 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 4 Sep 2021 16:43:14 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1630773794; b=ZvACeQBxHkmzyjZAeUdVEMfHj3GzNQfK0Tm7++bGKuOiChH709tqdnf3DxiJAwv1jBDilNbOAb 60mt84u9w+9mUjGtAAK1xooSemfj8l6rYn7+qhgLrD/8Mmq9hlMchGvC5be2XPy/WH3XG1L2yX ISGpq+PYz0fHFo815hCyUXPLaUf4Bw33dU2hH6TDFTsDZK1inr9opXBuj/qmLNpQ8QxGbSPe9U CGXuYm+DlQzeHng3K361aFqnyxh2NgP5xZvtFRrB0rgM7RZHCQohsko84A18mmiKz7Bi3fbpYU R4QiNN+AJO/Z+ZsD18r6wHZWFB7duRzfVTRklsuoG6dieg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (humanalyse.com) smtp.remote-ip=18.184.242.35; dmarc=fail header.from=trustfood.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1630773794; bh=QfyKCmtnhelamICGfcB9raPdzR0Rsvdf98Q/97GWBp4=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:MIME-Version:Message-ID:Subject:To:From:Date: DKIM-Signature; b=OwU6sCsd1Kwc9aMIZpxQ/s+m7fllV2WEsPZPUq0aBpfd+Z7wR+yWxfzVDZ8D0jh5yeipUE6ZCm 3RtWIy6FA/tKyLiwzCODN1BDZ7hJ9lXmCvQDOtO6s5o3PtEyLfoqp2p4ItYKcVqbfSy5uc6tqI kkiYMD1yslqHJHyL/p30TuYgapcDCq7kE2fySr11jDdCfXp2MO43smgNDzjoWR9LftpgUJBNRm WpRJj1XL35aFRrVMfx/6ZZ08D/LJZ0My/fNk+ZcstmdAXFeO2ba5PxyB3P9sJ1uUsTDD3RQMgy kjjQyxXI6kIb1PBWD6fhxX7m5nn3MRXtwGuOuZcm//8hJg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:MIME-Version:Message-ID: Subject:To:From:Date:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=HLkW+vKvq7wxB5M0F3Wr9cseFkxUu+PR4ixUe8yW+ZU=; b=nCZdFSquZq1sgmFj2rsFGCz4TQ CtbDIZu8kIK03AV00yb6leNCNuWBupoj3BNBMB3xbv4YgESbPJs0YIo7UhOep5GFqWR7YEPXnF2bA UbvyBklDwUr5muDcPIkvO4xEQv2rcCCmEN0FzZXyeR1iXO1XY0DhSvL57Fzl5io1mgKn2qN8tIgV+ 4lKhOfvqJgFqtQVoL+TOqQAMFkCKq49vEh3CvVjgp7P2Hz/ff49zCJz7skejhtNYShNAD1H+G8DVc VZWonL0Ercsa4zp9m+7Ttna3Yb7bTooB+EqnObKteJpwCgq0QqqZipBN+qq9Dl1cGElEq4Z5nCVgd NsgtrwvA==; Received: from authenticated user by zero.zsh.org with local id 1mMYl7-000OAV-U6; Sat, 04 Sep 2021 16:43:13 +0000 Authentication-Results: zsh.org; iprev=pass (humanalyse.com) smtp.remote-ip=18.184.242.35; dmarc=fail header.from=trustfood.org; arc=none Received: from humanalyse.com ([18.184.242.35]:60322 helo=trustfood.org) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mMYkS-000NRr-Tb; Sat, 04 Sep 2021 16:42:33 +0000 Received: by trustfood.org (Postfix, from userid 1001) id A107BE351; Sat, 4 Sep 2021 18:42:32 +0200 (CEST) Date: Sat, 4 Sep 2021 18:42:32 +0200 From: Eric Smith To: zsh-users@zsh.org Subject: Make a function name an alias for another function Message-ID: <20210904164232.dmd2z4jiin7rsf5k@trustfood.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Seq: 27083 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Hey zsh-ers, I would like to have a function defined in one place. POST() {curl --silent -X $0 -H "Content-Type: application/json" http://admin:3/api/$@ | jq '.'} GET() {curl --silent -X $0 -H "Content-Type: application/json" http://admin:3/api/$@ | jq '.'} DELETE() {curl --silent -X $0 -H "Content-Type: application/json" http://admin:3/api/$@ | jq '.'} Not three like this. How can I make like POST() = GET() Then I can call GET() and it will run the same function but return of cause an alternate $0 Thanks for any tips. Best wishes Eric