git: 1a2c45ccc4de - main - devel/argc: New port: Easily parse command line arguments in bash

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Tue, 03 Jan 2023 00:37:26 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1a2c45ccc4de6dedb6068d31e28d0e1aa3c930fd

commit 1a2c45ccc4de6dedb6068d31e28d0e1aa3c930fd
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2023-01-02 23:24:20 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2023-01-03 00:37:15 +0000

    devel/argc: New port: Easily parse command line arguments in bash
---
 devel/Makefile       |   1 +
 devel/argc/Makefile  |  90 +++++++++++++++++++++++++++++++++++
 devel/argc/distinfo  | 131 +++++++++++++++++++++++++++++++++++++++++++++++++++
 devel/argc/pkg-descr |   6 +++
 4 files changed, 228 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index 97a006db001f..dfa6bf4c0e0c 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -187,6 +187,7 @@
     SUBDIR += arduino-tools
     SUBDIR += arduino18
     SUBDIR += arduinoOTA
+    SUBDIR += argc
     SUBDIR += argdata
     SUBDIR += argobots
     SUBDIR += argouml
diff --git a/devel/argc/Makefile b/devel/argc/Makefile
new file mode 100644
index 000000000000..77daa3cad2ba
--- /dev/null
+++ b/devel/argc/Makefile
@@ -0,0 +1,90 @@
+PORTNAME=	argc
+DISTVERSIONPREFIX=	v
+DISTVERSION=	0.12.0
+CATEGORIES=	devel
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	Easily parse command line arguments in bash
+WWW=		https://github.com/sigoden/argc
+
+LICENSE=	APACHE20 MIT
+LICENSE_COMB=	dual
+LICENSE_FILE_APACHE20=	${WRKSRC}/LICENSE-APACHE
+LICENSE_FILE_MIT=	${WRKSRC}/LICENSE-MIT
+
+USES=		cargo
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	sigoden
+
+CARGO_CRATES=	aho-corasick-0.7.19 \
+		anyhow-1.0.65 \
+		assert_cmd-2.0.4 \
+		assert_fs-1.0.7 \
+		atty-0.2.14 \
+		autocfg-1.1.0 \
+		bitflags-1.3.2 \
+		bstr-0.2.17 \
+		cfg-if-1.0.0 \
+		clap-4.0.2 \
+		clap_lex-0.3.0 \
+		console-0.15.1 \
+		convert_case-0.5.0 \
+		crossbeam-utils-0.8.11 \
+		difflib-0.4.0 \
+		doc-comment-0.3.3 \
+		either-1.8.0 \
+		encode_unicode-0.3.6 \
+		fastrand-1.8.0 \
+		float-cmp-0.9.0 \
+		fnv-1.0.7 \
+		globset-0.4.9 \
+		globwalk-0.8.1 \
+		hashbrown-0.12.3 \
+		hermit-abi-0.1.19 \
+		ignore-0.4.18 \
+		indexmap-1.9.1 \
+		insta-1.20.0 \
+		instant-0.1.12 \
+		itertools-0.10.5 \
+		lazy_static-1.4.0 \
+		libc-0.2.133 \
+		linked-hash-map-0.5.6 \
+		log-0.4.17 \
+		memchr-2.5.0 \
+		minimal-lexical-0.2.1 \
+		nom-7.1.1 \
+		normalize-line-endings-0.3.0 \
+		num-traits-0.2.15 \
+		once_cell-1.15.0 \
+		os_str_bytes-6.3.0 \
+		predicates-2.1.1 \
+		predicates-core-1.0.3 \
+		predicates-tree-1.0.5 \
+		redox_syscall-0.2.16 \
+		regex-1.6.0 \
+		regex-automata-0.1.10 \
+		regex-syntax-0.6.27 \
+		remove_dir_all-0.5.3 \
+		same-file-1.0.6 \
+		similar-2.2.0 \
+		strsim-0.10.0 \
+		tempfile-3.3.0 \
+		termcolor-1.1.3 \
+		terminal_size-0.1.17 \
+		termtree-0.2.4 \
+		thread_local-1.1.4 \
+		wait-timeout-0.2.0 \
+		walkdir-2.3.2 \
+		winapi-0.3.9 \
+		winapi-i686-pc-windows-gnu-0.4.0 \
+		winapi-util-0.1.5 \
+		winapi-x86_64-pc-windows-gnu-0.4.0 \
+		yaml-rust-0.4.5
+
+PLIST_FILES=	bin/${PORTNAME}
+
+post-install:
+	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
+
+.include <bsd.port.mk>
diff --git a/devel/argc/distinfo b/devel/argc/distinfo
new file mode 100644
index 000000000000..23c1ae309e57
--- /dev/null
+++ b/devel/argc/distinfo
@@ -0,0 +1,131 @@
+TIMESTAMP = 1672701426
+SHA256 (rust/crates/aho-corasick-0.7.19.crate) = b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e
+SIZE (rust/crates/aho-corasick-0.7.19.crate) = 113070
+SHA256 (rust/crates/anyhow-1.0.65.crate) = 98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602
+SIZE (rust/crates/anyhow-1.0.65.crate) = 43585
+SHA256 (rust/crates/assert_cmd-2.0.4.crate) = 93ae1ddd39efd67689deb1979d80bad3bf7f2b09c6e6117c8d1f2443b5e2f83e
+SIZE (rust/crates/assert_cmd-2.0.4.crate) = 22581
+SHA256 (rust/crates/assert_fs-1.0.7.crate) = cf09bb72e00da477c2596865e8873227e2196d263cca35414048875dbbeea1be
+SIZE (rust/crates/assert_fs-1.0.7.crate) = 17519
+SHA256 (rust/crates/atty-0.2.14.crate) = d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8
+SIZE (rust/crates/atty-0.2.14.crate) = 5470
+SHA256 (rust/crates/autocfg-1.1.0.crate) = d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa
+SIZE (rust/crates/autocfg-1.1.0.crate) = 13272
+SHA256 (rust/crates/bitflags-1.3.2.crate) = bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a
+SIZE (rust/crates/bitflags-1.3.2.crate) = 23021
+SHA256 (rust/crates/bstr-0.2.17.crate) = ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223
+SIZE (rust/crates/bstr-0.2.17.crate) = 330350
+SHA256 (rust/crates/cfg-if-1.0.0.crate) = baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd
+SIZE (rust/crates/cfg-if-1.0.0.crate) = 7934
+SHA256 (rust/crates/clap-4.0.2.crate) = 31c9484ccdc4cb8e7b117cbd0eb150c7c0f04464854e4679aeb50ef03b32d003
+SIZE (rust/crates/clap-4.0.2.crate) = 201269
+SHA256 (rust/crates/clap_lex-0.3.0.crate) = 0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8
+SIZE (rust/crates/clap_lex-0.3.0.crate) = 9671
+SHA256 (rust/crates/console-0.15.1.crate) = 89eab4d20ce20cea182308bca13088fecea9c05f6776cf287205d41a0ed3c847
+SIZE (rust/crates/console-0.15.1.crate) = 31674
+SHA256 (rust/crates/convert_case-0.5.0.crate) = fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8
+SIZE (rust/crates/convert_case-0.5.0.crate) = 17902
+SHA256 (rust/crates/crossbeam-utils-0.8.11.crate) = 51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc
+SIZE (rust/crates/crossbeam-utils-0.8.11.crate) = 40887
+SHA256 (rust/crates/difflib-0.4.0.crate) = 6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8
+SIZE (rust/crates/difflib-0.4.0.crate) = 7638
+SHA256 (rust/crates/doc-comment-0.3.3.crate) = fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10
+SIZE (rust/crates/doc-comment-0.3.3.crate) = 4123
+SHA256 (rust/crates/either-1.8.0.crate) = 90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797
+SIZE (rust/crates/either-1.8.0.crate) = 15992
+SHA256 (rust/crates/encode_unicode-0.3.6.crate) = a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f
+SIZE (rust/crates/encode_unicode-0.3.6.crate) = 45741
+SHA256 (rust/crates/fastrand-1.8.0.crate) = a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499
+SIZE (rust/crates/fastrand-1.8.0.crate) = 11369
+SHA256 (rust/crates/float-cmp-0.9.0.crate) = 98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4
+SIZE (rust/crates/float-cmp-0.9.0.crate) = 10102
+SHA256 (rust/crates/fnv-1.0.7.crate) = 3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1
+SIZE (rust/crates/fnv-1.0.7.crate) = 11266
+SHA256 (rust/crates/globset-0.4.9.crate) = 0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a
+SIZE (rust/crates/globset-0.4.9.crate) = 22929
+SHA256 (rust/crates/globwalk-0.8.1.crate) = 93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc
+SIZE (rust/crates/globwalk-0.8.1.crate) = 13705
+SHA256 (rust/crates/hashbrown-0.12.3.crate) = 8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888
+SIZE (rust/crates/hashbrown-0.12.3.crate) = 102968
+SHA256 (rust/crates/hermit-abi-0.1.19.crate) = 62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33
+SIZE (rust/crates/hermit-abi-0.1.19.crate) = 9979
+SHA256 (rust/crates/ignore-0.4.18.crate) = 713f1b139373f96a2e0ce3ac931cd01ee973c3c5dd7c40c0c2efe96ad2b6751d
+SIZE (rust/crates/ignore-0.4.18.crate) = 53174
+SHA256 (rust/crates/indexmap-1.9.1.crate) = 10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e
+SIZE (rust/crates/indexmap-1.9.1.crate) = 54114
+SHA256 (rust/crates/insta-1.20.0.crate) = 58a931b01c76064c5be919faa2ef0dc570e9a889dcd1e5fef08a8ca6eb4d6c0b
+SIZE (rust/crates/insta-1.20.0.crate) = 533907
+SHA256 (rust/crates/instant-0.1.12.crate) = 7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c
+SIZE (rust/crates/instant-0.1.12.crate) = 6128
+SHA256 (rust/crates/itertools-0.10.5.crate) = b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473
+SIZE (rust/crates/itertools-0.10.5.crate) = 115354
+SHA256 (rust/crates/lazy_static-1.4.0.crate) = e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646
+SIZE (rust/crates/lazy_static-1.4.0.crate) = 10443
+SHA256 (rust/crates/libc-0.2.133.crate) = c0f80d65747a3e43d1596c7c5492d95d5edddaabd45a7fcdb02b95f644164966
+SIZE (rust/crates/libc-0.2.133.crate) = 603256
+SHA256 (rust/crates/linked-hash-map-0.5.6.crate) = 0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f
+SIZE (rust/crates/linked-hash-map-0.5.6.crate) = 15049
+SHA256 (rust/crates/log-0.4.17.crate) = abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e
+SIZE (rust/crates/log-0.4.17.crate) = 38028
+SHA256 (rust/crates/memchr-2.5.0.crate) = 2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d
+SIZE (rust/crates/memchr-2.5.0.crate) = 65812
+SHA256 (rust/crates/minimal-lexical-0.2.1.crate) = 68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a
+SIZE (rust/crates/minimal-lexical-0.2.1.crate) = 94841
+SHA256 (rust/crates/nom-7.1.1.crate) = a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36
+SIZE (rust/crates/nom-7.1.1.crate) = 115818
+SHA256 (rust/crates/normalize-line-endings-0.3.0.crate) = 61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be
+SIZE (rust/crates/normalize-line-endings-0.3.0.crate) = 5737
+SHA256 (rust/crates/num-traits-0.2.15.crate) = 578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd
+SIZE (rust/crates/num-traits-0.2.15.crate) = 49262
+SHA256 (rust/crates/once_cell-1.15.0.crate) = e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1
+SIZE (rust/crates/once_cell-1.15.0.crate) = 31460
+SHA256 (rust/crates/os_str_bytes-6.3.0.crate) = 9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff
+SIZE (rust/crates/os_str_bytes-6.3.0.crate) = 22928
+SHA256 (rust/crates/predicates-2.1.1.crate) = a5aab5be6e4732b473071984b3164dbbfb7a3674d30ea5ff44410b6bcd960c3c
+SIZE (rust/crates/predicates-2.1.1.crate) = 23150
+SHA256 (rust/crates/predicates-core-1.0.3.crate) = da1c2388b1513e1b605fcec39a95e0a9e8ef088f71443ef37099fa9ae6673fcb
+SIZE (rust/crates/predicates-core-1.0.3.crate) = 7757
+SHA256 (rust/crates/predicates-tree-1.0.5.crate) = 4d86de6de25020a36c6d3643a86d9a6a9f552107c0559c60ea03551b5e16c032
+SIZE (rust/crates/predicates-tree-1.0.5.crate) = 8126
+SHA256 (rust/crates/redox_syscall-0.2.16.crate) = fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a
+SIZE (rust/crates/redox_syscall-0.2.16.crate) = 24012
+SHA256 (rust/crates/regex-1.6.0.crate) = 4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b
+SIZE (rust/crates/regex-1.6.0.crate) = 239329
+SHA256 (rust/crates/regex-automata-0.1.10.crate) = 6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132
+SIZE (rust/crates/regex-automata-0.1.10.crate) = 114533
+SHA256 (rust/crates/regex-syntax-0.6.27.crate) = a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244
+SIZE (rust/crates/regex-syntax-0.6.27.crate) = 297300
+SHA256 (rust/crates/remove_dir_all-0.5.3.crate) = 3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7
+SIZE (rust/crates/remove_dir_all-0.5.3.crate) = 9184
+SHA256 (rust/crates/same-file-1.0.6.crate) = 93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502
+SIZE (rust/crates/same-file-1.0.6.crate) = 10183
+SHA256 (rust/crates/similar-2.2.0.crate) = 62ac7f900db32bf3fd12e0117dd3dc4da74bc52ebaac97f39668446d89694803
+SIZE (rust/crates/similar-2.2.0.crate) = 50996
+SHA256 (rust/crates/strsim-0.10.0.crate) = 73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623
+SIZE (rust/crates/strsim-0.10.0.crate) = 11355
+SHA256 (rust/crates/tempfile-3.3.0.crate) = 5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4
+SIZE (rust/crates/tempfile-3.3.0.crate) = 27578
+SHA256 (rust/crates/termcolor-1.1.3.crate) = bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755
+SIZE (rust/crates/termcolor-1.1.3.crate) = 17242
+SHA256 (rust/crates/terminal_size-0.1.17.crate) = 633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df
+SIZE (rust/crates/terminal_size-0.1.17.crate) = 9141
+SHA256 (rust/crates/termtree-0.2.4.crate) = 507e9898683b6c43a9aa55b64259b721b52ba226e0f3779137e50ad114a4c90b
+SIZE (rust/crates/termtree-0.2.4.crate) = 4416
+SHA256 (rust/crates/thread_local-1.1.4.crate) = 5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180
+SIZE (rust/crates/thread_local-1.1.4.crate) = 13106
+SHA256 (rust/crates/wait-timeout-0.2.0.crate) = 9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6
+SIZE (rust/crates/wait-timeout-0.2.0.crate) = 12441
+SHA256 (rust/crates/walkdir-2.3.2.crate) = 808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56
+SIZE (rust/crates/walkdir-2.3.2.crate) = 23516
+SHA256 (rust/crates/winapi-0.3.9.crate) = 5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419
+SIZE (rust/crates/winapi-0.3.9.crate) = 1200382
+SHA256 (rust/crates/winapi-i686-pc-windows-gnu-0.4.0.crate) = ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6
+SIZE (rust/crates/winapi-i686-pc-windows-gnu-0.4.0.crate) = 2918815
+SHA256 (rust/crates/winapi-util-0.1.5.crate) = 70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178
+SIZE (rust/crates/winapi-util-0.1.5.crate) = 10164
+SHA256 (rust/crates/winapi-x86_64-pc-windows-gnu-0.4.0.crate) = 712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f
+SIZE (rust/crates/winapi-x86_64-pc-windows-gnu-0.4.0.crate) = 2947998
+SHA256 (rust/crates/yaml-rust-0.4.5.crate) = 56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85
+SIZE (rust/crates/yaml-rust-0.4.5.crate) = 47783
+SHA256 (sigoden-argc-v0.12.0_GH0.tar.gz) = fee3a078d733c59c5ddd646d512dd67fdcdc4bcfb34597a175acf87460af0856
+SIZE (sigoden-argc-v0.12.0_GH0.tar.gz) = 30113
diff --git a/devel/argc/pkg-descr b/devel/argc/pkg-descr
new file mode 100644
index 000000000000..d43d8650003d
--- /dev/null
+++ b/devel/argc/pkg-descr
@@ -0,0 +1,6 @@
+argc allows to easily parse command line arguments in bash.
+
+To write a command-line program with argc, we only need to do two things:
+1. Describe options, flags, positional parameters and subcommands in comments.
+2. Insert `eval $(argc "$0" "$@")` into script to let argc to parse command line
+   arguments.