]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Create generic command / arg parsing routines
authorimp <imp@FreeBSD.org>
Tue, 16 Jul 2019 17:24:03 +0000 (17:24 +0000)
committerimp <imp@FreeBSD.org>
Tue, 16 Jul 2019 17:24:03 +0000 (17:24 +0000)
commit82756b7b8e86ff8fac0382b0f434a09d9f3e887d
tree62a8545f7fb0a79b2f5edb5129568556bf91cf27
parent7cb7e97884d35fcd943214dc37cc15867ba41261
Create generic command / arg parsing routines

Create a set of routines and structures to hold the data for the args
for a command. Use them to generate help and to parse args. Convert
all the current commands over to the new format. "comnd" is a hat-tip
to the TOPS-20 %COMND JSYS that (very) loosely inspired much of the
subsequent command line notions in the industry, but this is far
simpler (the %COMND man page is longer than this code) and not in the
kernel... Also, it implements today's de-facto
command [verb]+ [opts]* [args]*
format rather than the old, archaic TOPS-20 command format :)

This is a snapshot of a work in progress to get the nvme passthru
stuff committed. In time it will become a private library and used
by some other programs in the tree that conform to the above pattern.

Differential Revision: https://reviews.freebsd.org/D19296
15 files changed:
sbin/nvmecontrol/Makefile
sbin/nvmecontrol/comnd.c [new file with mode: 0644]
sbin/nvmecontrol/comnd.h [new file with mode: 0644]
sbin/nvmecontrol/devlist.c
sbin/nvmecontrol/firmware.c
sbin/nvmecontrol/format.c
sbin/nvmecontrol/identify.c
sbin/nvmecontrol/logpage.c
sbin/nvmecontrol/modules/wdc/wdc.c
sbin/nvmecontrol/ns.c
sbin/nvmecontrol/nvmecontrol.c
sbin/nvmecontrol/nvmecontrol.h
sbin/nvmecontrol/perftest.c
sbin/nvmecontrol/power.c
sbin/nvmecontrol/reset.c