打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Argtable is an ANSI C library for parsing GNU style command line options

The Argtable Homepage

Argtable is an ANSI C command line parser.

Stewart Heitmann
sheitmann@users.sourceforge.net

Overview

Argtable is an ANSI C library for parsing GNU style command line options with a minimum of fuss. It enables a program's command line syntax to be defined in the source code as an array of argtable structs. The command line is then parsed according to that specification and the resulting values are returned in those same structs where they are accessible to the main program. Both tagged (-v, --verbose, --foo=bar) and untagged arguments are supported, as are multiple instances of each argument. Syntax error handling is automatic and the library also provides the means for generating a textual description of the command line syntax, as in the following example:

myprog [-lRv] [-k <int>] [-D MACRO]... [-o <output>] [--help] [--version] <file> [<file>]...

-l, -L

list files

-R

recurse through subdirectories

-k, --scalar=<int>

define scalar value k (default is 3)

-D, --define=MACRO

macro definitions

-o <output>

output file (default is "-")

-v, --verbose, --debug

verbose messages

--help

print this help and exit

--version

print version information and exit

<file>

input file(s)

The argtable parsing, validation, and error reporting routines may be replaced by user-defined callbacks if desired and new argtable data types may be created to parse user-defined argument types. The parsing itself is done using GNU getopt so the parser is 100% GNU compatible. Care has also been taken to make the internal command line buffer handling secure against buffer overun attacks, as might be attempted with maliciously long command lines.

It runs on Linux, FreeBSD, NetBSD, OpenBSD, Cygwin, Sun Solaris, IBM AIX, SGI IRIX, Apple Mac OS X and Microsoft Windows platforms. It is known to compile with GCC, DJGPP, Visual C++, Open Watcom, MinGW, Texas Instruments DSP Compiler and should compile with any standard ANSI C compiler.

Argtable is open-source software that is distributed under the terms of the GNU Library General Public License (LGPL). It is available from NetBSD ports (devel/argtable), FreeBSD ports (devel/argtable), OpenBSD ports (devel/argtable), Mac OS X Darwin ports (devel/argtable), Mac OS X FinkProject (libargtable2-shlibs), Gentoo Linux (dev-libs/argtable), Debian Linux (libdevel/libargtable2-dev), Ubuntu Linux (libdevel/libargtable2-dev), and Sunfreeware http://www.sunfreeware.com/. Precompiled Dev-C++ devpaks are available from http://devpaks.org/category.php?category=Text+console.
Also check below for the latest version.


Documentation

"Introduction to Argtable-2.x" (html) (postscript) (pdf) (italiano)

A tutorial-style introduction to command line parsing using argtable-2.x.

"Advanced Argtable-2.x Topics" (html) (postscript) (pdf)

A collection of topics on advanced argtable-2.x parsing techniques.

"The Argtable-2.x Man Page" (html) (postscript) (pdf)

The argtable-2.x programmer's reference manual.

"Argtable Example Code" (html).

Source code examples showing how to parse the command line of a selection of common GNU utilities (echo, ls, mv, rm, uname) plus some generic examples demonstrating basic argtable features.


Downloads

Version 2.13 (ChangeLog), released Jan 10, 2011

This release includes improved parsing of filepaths and filenames and adds support for the CMake tool.

argtable2-13.tar.gz (source code, 3.2MB)

Version 1.4 (DEPRECATED 2003)

The argtable 1.x series has been long deprecated, but is still provided for backward compatibility as the argtable 2.x series does not support legacy code using the argtable 1.x series library. Both argtable 1.x and 2.x series libraries will happily coexist on the same system, so you may install them together if you wish. New users will not need this version at all.

argtable-1.4.tar.gz (source code, 442KB)

Rpm packages and previous releases are also available on the Sourceforge argtable downloads site.


History

Argtable debuted on sunsite.unc.edu in November 1998 and was relocated to sourceforge.net in December 2001. The argtable-1.x series was replaced by the argtable-2.x series in October 2003.


Thanks to

Nina Clemson for editing the original argtable-1.0 documentation.
Livio Bertacco for contributing bug fixes and the argtable-2.x Visual C++ Makefiles.
Justin Dearing for contributing bug fixes and Windows DLL support, plus code support for the Open Watcom compiler and help with the Mac OS X configuration.
Asa Packer for contributing bug fixes and upgrades to the Visual C++ Makefiles.
Danilo Cicerone for the Italian translation of "Introduction to Argtable-2x" and the argtable devpak.
Uli Fouquet for configuration patches and documentation related to cross-compiling argtable from Unix to Windows as well as providing the arg_print_glossary_gnu function.
Shachar Schemesh for integrating argtable into Debian Linux and kick-starting the migration to automake/autoconf.
Jasper Lievisse Adriaanse for maintaining the argtable package in OpenBSD ports.
Ulrich Mohr for bug fixes relating to Texas Instrument DSP platforms.
John Vickers and Steve O'Neil for bug fixes relating to Solaris/Motorola platforms.
Lori A. Pritchett-Sheats for fixing a makefile bug relating to "make dist".
Paolo Bormida for instructions on building argtable with date and regex support on Windows.
Michel Valin for bug fixes relating to the configure scripts on IBM AIX platforms and instructions on compiling the example code under AIX.
Steve Christensen for providing prebuilt packages for SPARC/Solaris and x86/Solaris platforms on http://www.sunfreeware.com/.
Jess Portnoy for reworking the rpm package and integrating argtable into Fedora Linux.
Michael Brown for incorporating support for pkg-config into the autoconf scripts.
Alexander Lindert for extensions to the parser to support hex, octal and binary integer formats as well as KB/MB/GB suffixes.
Rob Zaborowski for providing build configuration files for the CMake tool.
Moczik Gabor for bug fixes relating to the parsing of filepaths and filename extensions.
Hanspeter Niederstrasser for including the argtable package in FinkProject for Mac OS X.

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Wei: linker (ld) 在做 symbol resolving 的 order 跟過程
Ubuntu安装NRPE(Nagios插件)报:Cannot find ssl headers 解决方法!
How to install wxPython
关于Plone4.1.3及4.0.7不能在Ubuntu 11.10下安装
linux下c编程常识 - 阿勇__王者归来 - Linuxeden博客家园 - Powe...
【资源收集】免费的C/C++编译器、解释器及相关工具列表
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服