From patchwork Fri Dec 31 06:29:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 12701841 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9341FC433F5 for ; Fri, 31 Dec 2021 06:29:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229699AbhLaG3S (ORCPT ); Fri, 31 Dec 2021 01:29:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbhLaG3Q (ORCPT ); Fri, 31 Dec 2021 01:29:16 -0500 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90E59C061574 for ; Thu, 30 Dec 2021 22:29:15 -0800 (PST) Received: by mail-wr1-x436.google.com with SMTP id s1so54444224wra.6 for ; Thu, 30 Dec 2021 22:29:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=Xpva9V0VXekHcV8IaadpbjJ5yqxOeAd4KKMHRJ2FS+c=; b=XuuFMmGP0mGL+z8SD+U6iambomy56S17j6D0Au2888e6O/Jgj9N962fi+rg8MUP06A uSsr+Ggj6dKX1z3zomlEXEmBoE6EmoT737FXwvi1C3N6m5YQLaaxArYZ1cIzUY85GeLN oJxLAtUF6iCneFXayWrDPKfjzcfq7Q4xlSqJt6MKx7v/howrg0LlMfsRMpsQ5TDKNbQv ZBw1XPjn0JTzWZS4pZufUqbTPlRPG9Qh79mRqttXiMs21qA7BxMu4iU5q+wRAb5fQf1M wVlI3+K0/ohJyRBHLbEinalrvOR53lcInCxJMe4JTbzbgHcsqT75dXDSQgMOjwPzyfLI wU4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=Xpva9V0VXekHcV8IaadpbjJ5yqxOeAd4KKMHRJ2FS+c=; b=yctXakhFjzCZkShIfNhJsTdGkNO5bwDFJI58eqNX0gyULAfNwrIP+QvWNeVr9Fb5tg Clw8Qzf/UDbv5OTN9OhEjzqbFEQRbzynYbz5ZrXRVjt4esZZcSnouCmqGff8ZJ0eF5e2 GVwGMDJGaFNP+4/3f2nKbNMkrwWjDZVsnsnOuL/i6aWaq0qfU93uTLBmJqEzb1+drciY 9J86fT92/JpXlMovd9UiwXOxhhyvr2Sv0JXrWxP7UTB8t+arBzE+4yHsp96SYODYl65g DRcMynqvZuTkTb3C8Hq4tvDOdBgUSQS9+LsZzUZgU7FRtPOBxT/iS7h3A6AjCXfk6GYu 6e8Q== X-Gm-Message-State: AOAM532SZBJHrHmNRkgRQwpvzDMIZCJU+jlBCyfht92X94LfzrhM1Kst wyJfhAbZgu5KlBCoz0K8IJZN6zrRwaE= X-Google-Smtp-Source: ABdhPJys9RzTY6RkIb8weRYjuNU9Gx5Q5nCm1cnEOiwPq3UpMmS3lwsLjJQX7eaztKeuSS/+5ckr7A== X-Received: by 2002:a05:6000:18ab:: with SMTP id b11mr24469138wri.564.1640932153970; Thu, 30 Dec 2021 22:29:13 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id c11sm31927537wmq.48.2021.12.30.22.29.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Dec 2021 22:29:13 -0800 (PST) Message-Id: <9bd3c6672c4232e0a5c0905b834146ca02af8a4b.1640932151.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 31 Dec 2021 06:29:10 +0000 Subject: [PATCH 1/2] builtin/reflog.c: use parse-options for expire subcommand Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: John Cai , John Cai Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: John Cai From: John Cai Switch out manual argv parsing for the reflog expire subcommand to use the parse-options API. Signed-off-by: "John Cai" --- builtin/reflog.c | 72 ++++++++++++++++++++++++------------------------ 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/builtin/reflog.c b/builtin/reflog.c index 175c83e7cc2..afaf5ba67e2 100644 --- a/builtin/reflog.c +++ b/builtin/reflog.c @@ -11,13 +11,8 @@ #include "revision.h" #include "reachable.h" #include "worktree.h" +#include "parse-options.h" -/* NEEDSWORK: switch to using parse_options */ -static const char reflog_expire_usage[] = -N_("git reflog expire [--expire=