Giter Site home page Giter Site logo

xopt's Introduction

XOpt CircleCI

The sane answer to POpt.

XOpt is a command line argument parsing library written in ANSI C. XOpt accepts arguments in GNU format and focuses on clean definition, taking stress off the implementation.

License

Originally by Josh Junon, released under CC0. Go nuts.

xopt's People

Contributors

nkzawa avatar qix- avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

vercel phytolizer

xopt's Issues

'-'

Specifying - by itself should should cause it to be returned as an extra.

However, it's being parsed as a singular option and simply getting ignored.

Sloppy shorts are broken

Sloppy shorts don't seem to work.

6: Test command: /src/qix-/xopt/test/test-case.sh "/src/qix-/xopt/build/xopt-test-sloppyshorts" "/src/qix-/xopt/test/sloppyshorts.out" "-i10" "-d" "14.5" "-s"some string"" "--" "--is-not-passed" "ignoreme"
6: Test timeout computed to be: 10000000
6: error: xopt test case failed (1):
6: args: «-i10» «-d» «14.5» «-s"some string"» «--» «--is-not-passed» «ignoreme»
6:
6: Error: short options cannot be combined: -i10
6/6 Test #6: xopt-sloppyshorts-test ...........***Failed    0.02 sec

After short options were fixed, double-options broke

Yes, this was working prior. 😐

static void on_verbose(const char *v, void *data, const struct xoptOption *option, bool longArg, const char **err) {
	(void) v;
	(void) option;
	(void) err;

	config *conf = (config *) data;

	assert(!longArg);

	if (conf->verbosity < 3) {
		++conf->verbosity;
	}
}

// ...
	{
		0, // only allow -v[v[v]]
		'v',
		offsetof(config, verbosity),
		&on_verbose,
		XOPT_TYPE_BOOL,
		0,
		"Increase verbosity (default level 0, max level 3)"
	},
// ...
$ ./app -vv
error: option doesn't take a value: -v

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.